Add uninstall and test scripts for SEBA
[iec.git] / src / use_cases / seba_on_arm / install / test.sh
diff --git a/src/use_cases/seba_on_arm/install/test.sh b/src/use_cases/seba_on_arm/install/test.sh
new file mode 100644 (file)
index 0000000..3577d3f
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash -ex
+# shellcheck disable=SC2016
+
+#Modified from https://github.com/cachengo/seba_charts/blob/master/scripts/mini_test.sh
+
+TOSCA_POD=`kubectl get pods | grep xos-tosca | cut -d " " -f1`
+TOSCA_IP=`kubectl describe pod $TOSCA_POD | grep Node: | cut -d "/" -f2`
+BBSIM_IP=`kubectl get services -n voltha | grep bbsim | tr -s ' ' | cut -d " " -f3`
+
+
+# Create the first model
+curl \
+  -H "xos-username: admin@opencord.org" \
+  -H "xos-password: letmein" \
+  -X POST \
+  --data-binary @fabric.yaml \
+  http://$TOSCA_IP:30007/run
+
+# Create the second model
+sed "s/{{bbsim_ip}}/$BBSIM_IP/g" olt.yaml > olt.yaml.tmp
+curl \
+  -H "xos-username: admin@opencord.org" \
+  -H "xos-password: letmein" \
+  -X POST \
+  --data-binary @olt.yaml.tmp \
+  http://$TOSCA_IP:30007/run
+rm olt.yaml.tmp