Richard Jankowski | 461cb97 | 2018-04-11 15:36:27 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Richard Jankowski | 461cb97 | 2018-04-11 15:36:27 -0400 | [diff] [blame] | 15 | |
| 16 | kubectl apply -f k8s/genie-cni-1.8.yml |
| 17 | |
| 18 | kubectl apply -f k8s/namespace.yml |
| 19 | kubectl apply -f k8s/single-node/consul.yml |
| 20 | kubectl apply -f k8s/single-node/zookeeper.yml |
| 21 | kubectl apply -f k8s/single-node/kafka.yml |
| 22 | kubectl apply -f k8s/single-node/fluentd.yml |
| 23 | |
| 24 | kubectl apply -f k8s/single-node/vcore_for_consul.yml |
| 25 | kubectl apply -f k8s/envoy_for_consul.yml |
| 26 | kubectl apply -f k8s/single-node/vcli.yml |
| 27 | kubectl apply -f k8s/single-node/ofagent.yml |
| 28 | kubectl apply -f k8s/single-node/netconf.yml |
| 29 | |
| 30 | sudo cat <<EOF > tests/itests/env/tmp-pon0.conf |
| 31 | { |
| 32 | "name": "pon0", |
| 33 | "type": "bridge", |
| 34 | "bridge": "pon0", |
| 35 | "isGateway": true, |
| 36 | "ipMask": true, |
| 37 | "ipam": { |
| 38 | "type": "host-local", |
| 39 | "subnet": "10.22.0.0/16", |
| 40 | "routes": [ |
| 41 | { "dst": "0.0.0.0/0" } |
| 42 | ] |
| 43 | } |
| 44 | } |
| 45 | EOF |
| 46 | |
| 47 | sudo cp tests/itests/env/tmp-pon0.conf /etc/cni/net.d/20-pon0.conf |
| 48 | rm tests/itests/env/tmp-pon0.conf |
| 49 | |
| 50 | kubectl apply -f k8s/freeradius-config.yml |
| 51 | kubectl apply -f k8s/freeradius.yml |
| 52 | kubectl apply -f k8s/olt.yml |
| 53 | |
| 54 | # An ONU container creates the pon0 bridge |
| 55 | kubectl apply -f k8s/onu.yml |
Richard Jankowski | 43f6763 | 2018-04-23 17:04:48 -0400 | [diff] [blame] | 56 | |
Richard Jankowski | 461cb97 | 2018-04-11 15:36:27 -0400 | [diff] [blame] | 57 | echo 8 > tests/itests/env/tmp_pon0_group_fwd_mask |
Richard Jankowski | 43f6763 | 2018-04-23 17:04:48 -0400 | [diff] [blame] | 58 | RETRY=30 |
| 59 | while [ $RETRY -gt 0 ]; |
| 60 | do |
| 61 | if [ -f /sys/class/net/pon0/bridge/group_fwd_mask ]; then |
| 62 | echo "pon0 found" |
| 63 | sudo cp tests/itests/env/tmp_pon0_group_fwd_mask /sys/class/net/pon0/bridge/group_fwd_mask |
| 64 | break |
| 65 | else |
| 66 | echo "waiting for pon0..." |
| 67 | RETRY=$(expr $RETRY - 1) |
| 68 | sleep 1 |
| 69 | fi |
| 70 | done |
| 71 | if [ $RETRY -eq 0 ]; then |
| 72 | echo "Timed out waiting for creation of bridge pon0" |
| 73 | fi |
Richard Jankowski | 461cb97 | 2018-04-11 15:36:27 -0400 | [diff] [blame] | 74 | rm tests/itests/env/tmp_pon0_group_fwd_mask |
| 75 | |
| 76 | kubectl apply -f k8s/rg.yml |
| 77 | sleep 20 |