feat(deployment): Added code to cleanup the testbed setup

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-12-31 17:32:51 +01:00
parent 20ee8191ce
commit 731bb902db
2 changed files with 8 additions and 4 deletions

View File

@@ -1,3 +0,0 @@
#!/bin/bash
ip -all netns delete

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
WEDGE_PASS="sudopasswordforwedge" WEDGE_PASS="TheWedgePassword"
USER_PASS="asdf1234" USER_PASS="asdf1234"
run_script_via_ssh() { run_script_via_ssh() {
@@ -40,6 +40,7 @@ wedge_setup() {
ssh ncs-wedge "echo $WEDGE_PASS | sudo -S systemctl daemon-reload" ssh ncs-wedge "echo $WEDGE_PASS | sudo -S systemctl daemon-reload"
ssh ncs-wedge "echo $WEDGE_PASS | sudo -S systemctl start l1switch.service" ssh ncs-wedge "echo $WEDGE_PASS | sudo -S systemctl start l1switch.service"
# We could probably wait on port 9999 opening on the wedge
echo "WAITING FOR BFSHELL..." echo "WAITING FOR BFSHELL..."
sleep 30 sleep 30
@@ -74,3 +75,9 @@ ssh ncs-node2 "echo $USER_PASS | sudo -S timeout $TIMEOUT ip netns exec tb_node2
# Get log # Get log
scp ncs-node1:timestamps_30123 . scp ncs-node1:timestamps_30123 .
# Cleanup
ssh ncs-wedge "echo $WEDGE_PASS | sudo -S systemctl stop l1switch.service"
ssh ncs-node1 "echo $USER_PASS | sudo -S ip -all netns delete "
ssh ncs-node2 "echo $USER_PASS | sudo -S ip -all netns delete "