blob: 55f087d71c27d95758704c8d00789eeb96ac7dbf [file] [log] [blame]
Richard Jankowski461cb972018-04-11 15:36:27 -04001#!/bin/bash
2
3kubectl apply -f k8s/genie-cni-1.8.yml
4
5kubectl apply -f k8s/namespace.yml
6kubectl apply -f k8s/single-node/consul.yml
7kubectl apply -f k8s/single-node/zookeeper.yml
8kubectl apply -f k8s/single-node/kafka.yml
9kubectl apply -f k8s/single-node/fluentd.yml
10
11kubectl apply -f k8s/single-node/vcore_for_consul.yml
12kubectl apply -f k8s/envoy_for_consul.yml
13kubectl apply -f k8s/single-node/vcli.yml
14kubectl apply -f k8s/single-node/ofagent.yml
15kubectl apply -f k8s/single-node/netconf.yml
16
17sudo cat <<EOF > tests/itests/env/tmp-pon0.conf
18{
19 "name": "pon0",
20 "type": "bridge",
21 "bridge": "pon0",
22 "isGateway": true,
23 "ipMask": true,
24 "ipam": {
25 "type": "host-local",
26 "subnet": "10.22.0.0/16",
27 "routes": [
28 { "dst": "0.0.0.0/0" }
29 ]
30 }
31}
32EOF
33
34sudo cp tests/itests/env/tmp-pon0.conf /etc/cni/net.d/20-pon0.conf
35rm tests/itests/env/tmp-pon0.conf
36
37kubectl apply -f k8s/freeradius-config.yml
38kubectl apply -f k8s/freeradius.yml
39kubectl apply -f k8s/olt.yml
40
41# An ONU container creates the pon0 bridge
42kubectl apply -f k8s/onu.yml
Richard Jankowski43f67632018-04-23 17:04:48 -040043
Richard Jankowski461cb972018-04-11 15:36:27 -040044echo 8 > tests/itests/env/tmp_pon0_group_fwd_mask
Richard Jankowski43f67632018-04-23 17:04:48 -040045RETRY=30
46while [ $RETRY -gt 0 ];
47do
48 if [ -f /sys/class/net/pon0/bridge/group_fwd_mask ]; then
49 echo "pon0 found"
50 sudo cp tests/itests/env/tmp_pon0_group_fwd_mask /sys/class/net/pon0/bridge/group_fwd_mask
51 break
52 else
53 echo "waiting for pon0..."
54 RETRY=$(expr $RETRY - 1)
55 sleep 1
56 fi
57done
58if [ $RETRY -eq 0 ]; then
59 echo "Timed out waiting for creation of bridge pon0"
60fi
Richard Jankowski461cb972018-04-11 15:36:27 -040061rm tests/itests/env/tmp_pon0_group_fwd_mask
62
63kubectl apply -f k8s/rg.yml
64sleep 20