blob: 54523a5363374b85143a2233be9f58fa36ffb860 [file] [log] [blame]
Richard Jankowski461cb972018-04-11 15:36:27 -04001#!/bin/bash
Zack Williams41513bf2018-07-07 20:08:35 -07002# 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 Jankowski461cb972018-04-11 15:36:27 -040015
16kubectl apply -f k8s/genie-cni-1.8.yml
17
18kubectl apply -f k8s/namespace.yml
19kubectl apply -f k8s/single-node/consul.yml
20kubectl apply -f k8s/single-node/zookeeper.yml
21kubectl apply -f k8s/single-node/kafka.yml
22kubectl apply -f k8s/single-node/fluentd.yml
23
24kubectl apply -f k8s/single-node/vcore_for_consul.yml
25kubectl apply -f k8s/envoy_for_consul.yml
26kubectl apply -f k8s/single-node/vcli.yml
27kubectl apply -f k8s/single-node/ofagent.yml
28kubectl apply -f k8s/single-node/netconf.yml
29
30sudo 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}
45EOF
46
47sudo cp tests/itests/env/tmp-pon0.conf /etc/cni/net.d/20-pon0.conf
48rm tests/itests/env/tmp-pon0.conf
49
50kubectl apply -f k8s/freeradius-config.yml
51kubectl apply -f k8s/freeradius.yml
52kubectl apply -f k8s/olt.yml
53
54# An ONU container creates the pon0 bridge
55kubectl apply -f k8s/onu.yml
Richard Jankowski43f67632018-04-23 17:04:48 -040056
Richard Jankowski461cb972018-04-11 15:36:27 -040057echo 8 > tests/itests/env/tmp_pon0_group_fwd_mask
Richard Jankowski43f67632018-04-23 17:04:48 -040058RETRY=30
59while [ $RETRY -gt 0 ];
60do
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
70done
71if [ $RETRY -eq 0 ]; then
72 echo "Timed out waiting for creation of bridge pon0"
73fi
Richard Jankowski461cb972018-04-11 15:36:27 -040074rm tests/itests/env/tmp_pon0_group_fwd_mask
75
76kubectl apply -f k8s/rg.yml
77sleep 20