diff --git a/src/tests/ofc24/2.device1.json b/src/tests/ofc24/2.device1.json index 3e31f31eb84630415f96b6af1e6ae5d34bdb1c89..c5a189e3165f4d170fb1c9e8b13314a202a84630 100755 --- a/src/tests/ofc24/2.device1.json +++ b/src/tests/ofc24/2.device1.json @@ -41,7 +41,7 @@ "action": 1, "custom": { "resource_key": "_connect/address", - "resource_value": "10.0.2.15" + "resource_value": "10.0.2.4" } }, { diff --git a/src/tests/ofc24/3.device2.json b/src/tests/ofc24/3.device2.json index 812affa7b8540b67f83d6f3c9bb9b5442c44fd0d..a38fc290508788637a1ebc1cef7ddc54514a46fe 100755 --- a/src/tests/ofc24/3.device2.json +++ b/src/tests/ofc24/3.device2.json @@ -41,7 +41,7 @@ "action": 1, "custom": { "resource_key": "_connect/address", - "resource_value": "10.0.2.15" + "resource_value": "10.0.2.4" } }, { diff --git a/src/tests/ofc24/4.device3_R1.json b/src/tests/ofc24/4.device3_R1.json index 3a57ba79cd2ff8aa6d4b666ac382932ade2f20e0..1c110f20ecb6c2d5081044c961dbf50e3d4c816d 100755 --- a/src/tests/ofc24/4.device3_R1.json +++ b/src/tests/ofc24/4.device3_R1.json @@ -107,7 +107,7 @@ "action": 1, "custom": { "resource_key": "_connect/address", - "resource_value": "10.0.2.15" + "resource_value": "10.0.2.4" } }, { diff --git a/src/tests/ofc24/5.device4_R2.json b/src/tests/ofc24/5.device4_R2.json index 9b1968d095c3e2c28c058b22f7295d7d1cbda380..43ebda5c6c139b4f2d8b2a51e7f42a257a38b4d4 100755 --- a/src/tests/ofc24/5.device4_R2.json +++ b/src/tests/ofc24/5.device4_R2.json @@ -108,7 +108,7 @@ "action": 1, "custom": { "resource_key": "_connect/address", - "resource_value": "10.0.2.15" + "resource_value": "10.0.2.4" } }, { diff --git a/src/tests/ofc24/startExtraNetConfigAgent.sh b/src/tests/ofc24/startExtraNetConfigAgent.sh index d9428585ef1040bb0440bf6db100b7f2bc71c970..f8638a51f289af6718e388db583d94da40653efb 100755 --- a/src/tests/ofc24/startExtraNetConfigAgent.sh +++ b/src/tests/ofc24/startExtraNetConfigAgent.sh @@ -13,22 +13,32 @@ # See the License for the specific language governing permissions and # limitations under the License. -DOCKER_CONTAINER=$1 -DOCKER_PORT=$2 - -if [ -n "$DOCKER_CONTAINER" ] && [ -n "$DOCKER_PORT" ];then - sudo docker stop "$DOCKER_CONTAINER" -t 1 - sudo docker rm "$DOCKER_CONTAINER" - - echo "Creating TPs" - screen -dmS t1 -T xterm sh -c "docker run -p 10.0.2.15:"$DOCKER_PORT":2022 -v ~/tfs-ctrl/tempOC/files:/files --name $DOCKER_CONTAINER -it asgamb1/oc23bgp.img:latest" - sleep 2 - if [ "$( docker container inspect -f '{{.State.Running}}' "$DOCKER_CONTAINER")" = "true" ]; then - docker exec "$DOCKER_CONTAINER" cp /files/demoECOC21_4.xml demoECOC21.xml - docker exec "$DOCKER_CONTAINER" /confd/examples.confd/OC23/startNetconfAgent.sh - else - echo "your container is not running yet" - fi + + + + +screen -dmS t1 -T xterm sh -c "docker run -p 10.0.2.4:2023:2022 -v ~/tfs-ctrl/src/tests/ofc24/tempOC/files:/files --name na1 -it asgamb1/oc23bgp.img:latest bash" +screen -dmS t2 -T xterm sh -c "docker run -p 10.0.2.4:2024:2022 -v ~/tfs-ctrl/src/tests/ofc24/tempOC/files:/files --name na2 -it asgamb1/oc23bgp.img:latest bash" + + + +sleep 4 +echo "starting transponder1 " + +if [ "$( docker container inspect -f '{{.State.Running}}' na1)" = "true" ]; then + docker exec na1 sh -c " cp /files/platform_t1.xml demoECOC21.xml ; + /confd/examples.confd/OC23/startNetconfAgent.sh;" + +else + echo "na1 container is not running yet" +fi + +echo "starting transponder2 " + +if [ "$( docker container inspect -f '{{.State.Running}}' na2)" = "true" ]; then + docker exec na2 sh -c " cp /files/platform_t2.xml demoECOC21.xml; + /confd/examples.confd/OC23/startNetconfAgent.sh " + else - echo "Please define the docker container name and port" -fi + echo "na2 container is not running yet" +fi \ No newline at end of file diff --git a/src/tests/ofc24/start_topo.sh b/src/tests/ofc24/start_topo.sh index c924064763c14e4da45344cd21f4d9c81c9640a9..ed93641c99420768271279735c8430c5a462935d 100755 --- a/src/tests/ofc24/start_topo.sh +++ b/src/tests/ofc24/start_topo.sh @@ -29,35 +29,42 @@ sudo docker rm na4 echo "Creating Transponder Agents" -# if ! docker image inspect "$IMAGE_NAME" >/dev/null 2>&1 ; then -# echo "asgamb1/oc23bgp.img:latest not existed ! " -# screen -dmS t3 -T xterm sh -c "docker run -p 10.0.2.15:2025:2022 -v ~/tempOC/files:/files --name na -it $IMAGE_NAME bash" -# echo 'start downloading asgamb1/oc23bgp.img:latest , it may take few minutes ! .... ' -# while [ "$(docker image inspect asgamb1/oc23bgp.img:latest 2>/dev/null)" == "[]" ]; do -# sleep 1 -# done + ./startExtraNetConfigAgent.sh -#fi +echo "Creating Roadms Agents" -screen -dmS t1 -T xterm sh -c "docker run -p 127.0.0.1:2023:2022 -v ~/tempOC/files:/files --name $DOCKER_CONTAINER -it asgamb1/oc23bgp.img:latest bash" -sleep 2 -if [ "$( docker container inspect -f '{{.State.Running}}' "$DOCKER_CONTAINER")" = "true" ]; then - docker exec "$DOCKER_CONTAINER" cp /files/demoECOC21_4.xml demoECOC21.xml - docker exec "$DOCKER_CONTAINER" /confd/examples.confd/OC23/startNetconfAgent.sh +screen -dmS t3 -T xterm sh -c 'docker run -p 10.0.2.4:2025:2022 -v ~/tfs-ctrl/src/tests/ofc24/tempOC/files:/files --name na3 -it asgamb1/flexscale-node.img:latest bash ' +screen -dmS t4 -T xterm sh -c 'docker run -p 10.0.2.4:2026:2022 -v ~/tfs-ctrl/src/tests/ofc24/tempOC/files:/files --name na4 -it asgamb1/flexscale-node.img:latest bash ' +sleep 4 + +echo "starting Roadm1 " + +if [ "$( docker container inspect -f '{{.State.Running}}' na4)" = "true" ]; then + docker exec na4 sh -c " cp /files/platform_r2.xml init_openconfig-platform.xml; + cp /files/startNetconfAgent.sh startNetconfAgent.sh; + /confd/examples.confd/OC23/startNetconfAgent.sh ;"& + else - echo "your container is not running yet" + echo "na4 is not running yet" fi -echo " It may take a while , Hang on ..." -source "./startExtraNetConfigAgent.sh" "na1" "2023" -sleep 3 -source "./startExtraNetConfigAgent.sh" "na2" "2024" -sleep 3 +echo "starting Roadm2 " + + + +if [ "$( docker container inspect -f '{{.State.Running}}' na3)" = "true" ]; then + docker exec na3 sh -c " cp /files/platform_r1.xml init_openconfig-platform.xml; + cp /files/startNetconfAgent.sh startNetconfAgent.sh; + /confd/examples.confd/OC23/startNetconfAgent.sh; " + +else + echo "na3 is not running yet" +fi + -bash -c "cp /tempOC/files/plat_r1.xml /confd/examples.confd/OC23/init_openconfig-platform.xml; ./startNetconfAgent.sh" -bash -c "cp /tempOC/files/plat_r2.xml /confd/examples.confd/OC23/init_openconfig-platform.xml; ./startNetconfAgent.sh" -screen -dmS t3 -T xterm sh -c 'docker run -p 10.0.2.15:2025:2022 -v ~/tfs-ctrl/tempOC/files:/files --name na3 -it asgamb1/flexscale-node.img:latest ./startNetconfAgent.sh' -screen -dmS t4 -T xterm sh -c 'docker run -p 10.0.2.15:2026:2022 -v ~/tfs-ctrl/tempOC/files:/files --name na4 -it asgamb1/flexscale-node.img:latest ./startNetconfAgent.sh' +# screen -S t3 -X stuff "cp ~/files/platform_r1.xml /confd/examples.confd/OC23/init_openconfig-platform.xml && ./startNetconfAgent.sh" +# bash -c "docker cp ~/tfs-ctrl/src/tests/ofc24/tempOC/files/platform_r2.xml na4:/confd/examples.confd/OC23/init_openconfig-platform.xml; +# docker cp ~/tfs-ctrl/src/tests/ofc24/tempOC/files/startNetconfAgent.sh na4:/confd/examples.confd/OC23/startNetconfAgent.sh;" diff --git a/src/tests/ofc24/platform_r1.xml b/src/tests/ofc24/tempOC/files/platform_r1.xml old mode 100755 new mode 100644 similarity index 100% rename from src/tests/ofc24/platform_r1.xml rename to src/tests/ofc24/tempOC/files/platform_r1.xml diff --git a/src/tests/ofc24/platform_r2.xml b/src/tests/ofc24/tempOC/files/platform_r2.xml old mode 100755 new mode 100644 similarity index 100% rename from src/tests/ofc24/platform_r2.xml rename to src/tests/ofc24/tempOC/files/platform_r2.xml diff --git a/src/tests/ofc24/platform_t1.xml b/src/tests/ofc24/tempOC/files/platform_t1.xml old mode 100755 new mode 100644 similarity index 100% rename from src/tests/ofc24/platform_t1.xml rename to src/tests/ofc24/tempOC/files/platform_t1.xml diff --git a/src/tests/ofc24/platform_t2.xml b/src/tests/ofc24/tempOC/files/platform_t2.xml old mode 100755 new mode 100644 similarity index 100% rename from src/tests/ofc24/platform_t2.xml rename to src/tests/ofc24/tempOC/files/platform_t2.xml diff --git a/src/tests/ofc24/startNetconfAgent.sh b/src/tests/ofc24/tempOC/files/startNetconfAgent.sh old mode 100755 new mode 100644 similarity index 100% rename from src/tests/ofc24/startNetconfAgent.sh rename to src/tests/ofc24/tempOC/files/startNetconfAgent.sh