Add PONSim installation scripts
[iec.git] / src / use_cases / seba_on_arm / test / bbsim / test.sh
1 #!/bin/bash -ex
2 # shellcheck disable=SC2016
3
4 TOSCA_POD=$(kubectl get pods | grep xos-tosca | cut -d " " -f1)
5 TOSCA_IP=$(kubectl describe pod "$TOSCA_POD" | grep Node: | cut -d "/" -f2)
6 BBSIM_IP=$(kubectl get services -n voltha | grep bbsim | tr -s ' ' | cut -d " " -f3)
7
8
9 # Create the first model
10 curl \
11   -H "xos-username: admin@opencord.org" \
12   -H "xos-password: letmein" \
13   -X POST \
14   --data-binary @fabric.yaml \
15   "http://$TOSCA_IP:30007/run"
16
17 # Create the second model
18 sed "s/{{bbsim_ip}}/$BBSIM_IP/g" olt.yaml > olt.yaml.tmp
19 curl \
20   -H "xos-username: admin@opencord.org" \
21   -H "xos-password: letmein" \
22   -X POST \
23   --data-binary @olt.yaml.tmp \
24   "http://$TOSCA_IP:30007/run"
25 rm olt.yaml.tmp