From 60bdf1706fdb8a25947e98a48355350c3fab8ab6 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Fri, 25 Oct 2024 16:47:51 +0000 Subject: [PATCH] Pre-merge code cleanup --- src/tests/ofc24/get_all.sh | 20 ++++++++--- src/tests/ofc24/get_bands.sh | 21 ++++++++--- src/tests/ofc24/get_lightpath.sh | 21 ++++++++--- src/tests/ofc24/get_links.sh | 21 ++++++++--- src/tests/ofc24/r_t.sh | 2 +- src/tests/ofc24/run_test.sh | 35 +++++++++++-------- .../ofc24/tempOC/files/startNetconfAgent.sh | 14 ++++++++ 7 files changed, 100 insertions(+), 34 deletions(-) diff --git a/src/tests/ofc24/get_all.sh b/src/tests/ofc24/get_all.sh index 2f0412d46..ceb96a34c 100755 --- a/src/tests/ofc24/get_all.sh +++ b/src/tests/ofc24/get_all.sh @@ -1,6 +1,18 @@ #!/bin/bash +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License - ~/tfs-ctrl/src/tests/ofc24/get_bands.sh > bands.json - ~/tfs-ctrl/src/tests/ofc24/get_links.sh > links.json - ~/tfs-ctrl/src/tests/ofc24/get_lightpath.sh > lightpath.json - +~/tfs-ctrl/src/tests/ofc24/get_bands.sh > bands.json +~/tfs-ctrl/src/tests/ofc24/get_links.sh > links.json +~/tfs-ctrl/src/tests/ofc24/get_lightpath.sh > lightpath.json diff --git a/src/tests/ofc24/get_bands.sh b/src/tests/ofc24/get_bands.sh index d4f01357d..c63461e44 100755 --- a/src/tests/ofc24/get_bands.sh +++ b/src/tests/ofc24/get_bands.sh @@ -1,11 +1,22 @@ #!/bin/bash -ip=$(sudo kubectl get all --all-namespaces | grep service/opticalcontrollerservice | awk '{print $4}') +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License -#echo $ip +ip=$(sudo kubectl get all --all-namespaces | grep service/opticalcontrollerservice | awk '{print $4}') +echo $ip #push=$(curl -X GET "http://$ip:10060/OpticalTFS/GetTopology/admin/admin") - links=$(curl -X GET "http://$ip:10060/OpticalTFS/GetOpticalBands") - -echo $links \ No newline at end of file +echo $links diff --git a/src/tests/ofc24/get_lightpath.sh b/src/tests/ofc24/get_lightpath.sh index f5c7206e7..eefd46c0e 100755 --- a/src/tests/ofc24/get_lightpath.sh +++ b/src/tests/ofc24/get_lightpath.sh @@ -1,11 +1,22 @@ #!/bin/bash -ip=$(sudo kubectl get all --all-namespaces | grep service/opticalcontrollerservice | awk '{print $4}') +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License -#echo $ip +ip=$(sudo kubectl get all --all-namespaces | grep service/opticalcontrollerservice | awk '{print $4}') +echo $ip #push=$(curl -X GET "http://$ip:10060/OpticalTFS/GetTopology/admin/admin") - links=$(curl -X GET "http://$ip:10060/OpticalTFS/GetLightpaths") - -echo $links \ No newline at end of file +echo $links diff --git a/src/tests/ofc24/get_links.sh b/src/tests/ofc24/get_links.sh index 2799934ad..f1146b4ea 100755 --- a/src/tests/ofc24/get_links.sh +++ b/src/tests/ofc24/get_links.sh @@ -1,11 +1,22 @@ #!/bin/bash -ip=$(sudo kubectl get all --all-namespaces | grep service/opticalcontrollerservice | awk '{print $4}') +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License -#echo $ip +ip=$(sudo kubectl get all --all-namespaces | grep service/opticalcontrollerservice | awk '{print $4}') +echo $ip #push=$(curl -X GET "http://$ip:10060/OpticalTFS/GetTopology/admin/admin") - links=$(curl -X GET "http://$ip:10060/OpticalTFS/GetLinks") - -echo $links \ No newline at end of file +echo $links diff --git a/src/tests/ofc24/r_t.sh b/src/tests/ofc24/r_t.sh index a8c1ae276..eef73563f 100755 --- a/src/tests/ofc24/r_t.sh +++ b/src/tests/ofc24/r_t.sh @@ -28,4 +28,4 @@ docker rm na2 screen -dmS t1 -T xterm sh -c "docker run --name t1 -p 10.0.2.4:2023:2022 -v /home/tfs/tfs-ctrl/src/tests/ofc24/tempOC/files:/files -it asgamb1/oc23bgp.img:latest bash -c 'cp /files/transponders_x4.xml demoECOC21.xml ; ./startNetconfAgent.sh'" screen -dmS t3 -T xterm sh -c "docker run --name na3 -p 10.0.2.4:2025:2022 -v /home/tfs/tfs-ctrl/src/tests/ofc24/tempOC/files:/files -it asgamb1/flexscale-node.img:latest bash -c 'cp /files/platform_r1.xml init_openconfig-platform.xml ; ./startNetconfAgent.sh'" screen -dmS t2 -T xterm sh -c "docker run --name t2 -p 10.0.2.4:2024:2022 -v /home/tfs/tfs-ctrl/src/tests/ofc24/tempOC/files:/files -it asgamb1/oc23bgp.img:latest bash -c 'cp /files/transponders_x4_2.xml demoECOC21.xml ; ./startNetconfAgent.sh'" -screen -dmS t4 -T xterm sh -c "docker run --name na2 -p 10.0.2.4:2026:2022 -v /home/tfs/tfs-ctrl/src/tests/ofc24/tempOC/files:/files -it asgamb1/flexscale-node.img:latest bash -c 'cp /files/platform_r2.xml init_openconfig-platform.xml ; ./startNetconfAgent.sh'" \ No newline at end of file +screen -dmS t4 -T xterm sh -c "docker run --name na2 -p 10.0.2.4:2026:2022 -v /home/tfs/tfs-ctrl/src/tests/ofc24/tempOC/files:/files -it asgamb1/flexscale-node.img:latest bash -c 'cp /files/platform_r2.xml init_openconfig-platform.xml ; ./startNetconfAgent.sh'" diff --git a/src/tests/ofc24/run_test.sh b/src/tests/ofc24/run_test.sh index a4cb46bb4..b1cbe33c9 100644 --- a/src/tests/ofc24/run_test.sh +++ b/src/tests/ofc24/run_test.sh @@ -1,17 +1,24 @@ #!/bin/bash +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License + docker stop na1 docker rm na1 - screen -dmS t1 -T xterm sh -c "docker run -p 10.0.2.10:2023:2022 -v ~/tfs-ctrl/src/tests/ofc24/tempOC/files:/files --name na1 -it asgamb1/oc23bgp.img:latest -" - sleep 2 - 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 "your container is not running yet" - fi - +screen -dmS t1 -T xterm sh -c "docker run -p 10.0.2.10:2023:2022 -v ~/tfs-ctrl/src/tests/ofc24/tempOC/files:/files --name na1 -it asgamb1/oc23bgp.img:latest" +sleep 2 +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 "your container is not running yet" +fi diff --git a/src/tests/ofc24/tempOC/files/startNetconfAgent.sh b/src/tests/ofc24/tempOC/files/startNetconfAgent.sh index 10b721883..35c95b657 100644 --- a/src/tests/ofc24/tempOC/files/startNetconfAgent.sh +++ b/src/tests/ofc24/tempOC/files/startNetconfAgent.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License + make clean make all #make init -- GitLab