Integration tests for GBP and GBP-SFC
[integration/test.git] / csit / suites / groupbasedpolicy / common_scripts / clean-demo.sh
diff --git a/csit/suites/groupbasedpolicy/common_scripts/clean-demo.sh b/csit/suites/groupbasedpolicy/common_scripts/clean-demo.sh
new file mode 100644 (file)
index 0000000..24e7b91
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+set -e
+
+sw=$(sudo ovs-vsctl show | egrep -E 'Bridge.*sw' | awk '{print $2}' | sed -e 's/^"//'  -e 's/"$//')
+if [ "$sw" ]
+then
+    sudo ovs-vsctl del-br $sw
+fi
+sudo ovs-vsctl del-manager;
+
+docker stop -t=1 $(docker ps -a -q) > /dev/null 2>&1
+docker rm $(docker ps -a -q) > /dev/null 2>&1
+
+sudo /etc/init.d/openvswitch-switch stop > /dev/null
+sudo rm /etc/openvswitch/conf.db > /dev/null
+sudo /etc/init.d/openvswitch-switch start > /dev/null
\ No newline at end of file