Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 1 | SHELL := /bin/bash |
| 2 | BUILD ?= /tmp |
| 3 | M ?= $(BUILD)/milestones |
| 4 | MAKEDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) |
| 5 | WORKSPACE ?= $(HOME) |
Andy Bavier | 6ce277e | 2018-10-02 10:29:21 -0700 | [diff] [blame] | 6 | VIRTUALENV ?= $(WORKSPACE)/cord/test |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 7 | SEBAVALUES ?= configs/seba-ponsim.yaml |
Kailash Khalasi | 98dabd0 | 2018-10-19 13:00:12 -0700 | [diff] [blame] | 8 | TESTTAGS ?= stable |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 9 | |
Zack Williams | 3bcdc26 | 2018-09-27 11:00:38 -0700 | [diff] [blame] | 10 | # used to start logging/monitoring and other infrastructure charts |
| 11 | INFRA_CHARTS ?= |
| 12 | INFRA_PREREQS = $(foreach chart,$(INFRA_CHARTS),$(M)/$(chart)) |
| 13 | |
Zack Williams | 2a6a107 | 2019-01-07 11:15:12 -0700 | [diff] [blame] | 14 | DOCKER_VERSION ?= "17.06" |
| 15 | |
| 16 | K8S_VERSION ?= "1.12.4" |
| 17 | |
| 18 | HELM_VERSION ?= "2.12.1" |
| 19 | HELM_SHA256SUM ?= "891004bec55431b39515e2cedc4f4a06e93782aa03a4904f2bd742b168160451" |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 20 | HELM_PLATFORM ?= "linux-amd64" |
| 21 | |
Zack Williams | 2a6a107 | 2019-01-07 11:15:12 -0700 | [diff] [blame] | 22 | KAFKA_CHART_VERSION ?= 0.13.3 |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 23 | KAFKA_POD := "pod/cord-kafka-0" |
Zack Williams | 3bcdc26 | 2018-09-27 11:00:38 -0700 | [diff] [blame] | 24 | |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 25 | # Targets |
| 26 | ponsim: $(M)/siab |
| 27 | |
| 28 | bbsim: $(M)/bbsim-tosca |
| 29 | |
| 30 | both: BBSIM_DHCP_TOSCA = |
| 31 | both: $(M)/siab $(M)/bbsim-tosca |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 32 | |
Andy Bavier | e5a16f6 | 2018-10-11 14:07:15 -0700 | [diff] [blame] | 33 | # https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html#SEC69 |
| 34 | latest: SEBAVALUES := configs/seba-ponsim-latest.yaml |
| 35 | latest: all |
| 36 | |
| 37 | stable: SEBAVALUES := configs/seba-ponsim.yaml |
| 38 | stable: all |
| 39 | |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 40 | siab-1.0: SEBAVALUES := configs/siab-v1.0.0.yaml |
| 41 | siab-1.0: KAFKA_POD := "pod/cord-platform-kafka-0" |
| 42 | # Parallel make won't work here; need to install seba-1.0.0 before siab |
| 43 | siab-1.0: $(M)/seba-1.0.0 $(M)/siab |
| 44 | |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 45 | $(M)/setup: |
| 46 | mkdir -p $(M) |
| 47 | sudo apt update |
| 48 | sudo apt install -y httpie jq software-properties-common |
| 49 | sudo swapoff -a |
Andy Bavier | 07779ea | 2018-10-03 15:13:22 -0700 | [diff] [blame] | 50 | sudo iptables -P FORWARD ACCEPT |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 51 | touch $@ |
| 52 | |
| 53 | /usr/bin/docker: | $(M)/setup |
| 54 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0EBFCD88 |
| 55 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(shell lsb_release -cs) stable" |
| 56 | sudo apt update |
Zack Williams | 2a6a107 | 2019-01-07 11:15:12 -0700 | [diff] [blame] | 57 | sudo apt install -y "docker-ce=${DOCKER_VERSION}*" |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 58 | |
| 59 | /usr/bin/kubeadm: | $(M)/setup /usr/bin/docker |
| 60 | curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
| 61 | echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /tmp/kubernetes.list |
| 62 | sudo cp /tmp/kubernetes.list /etc/apt/sources.list.d/kubernetes.list |
| 63 | sudo apt update |
Zack Williams | 2a6a107 | 2019-01-07 11:15:12 -0700 | [diff] [blame] | 64 | sudo apt install -y "kubeadm=${K8S_VERSION}-*" "kubelet=${K8S_VERSION}-*" "kubectl=${K8S_VERSION}-*" |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 65 | |
| 66 | /usr/local/bin/helm: |
| 67 | curl -L -o /tmp/helm.tgz "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${HELM_PLATFORM}.tar.gz" |
| 68 | echo "${HELM_SHA256SUM} /tmp/helm.tgz" | sha256sum -c - |
| 69 | cd /tmp; tar -xzvf helm.tgz; sudo mv ${HELM_PLATFORM}/helm /usr/local/bin/helm |
| 70 | sudo chmod a+x /usr/local/bin/helm |
| 71 | rm -rf /tmp/helm.tgz /tmp/${HELM_PLATFORM} |
| 72 | |
| 73 | $(M)/kubeadm: | $(M)/setup /usr/bin/kubeadm |
| 74 | sudo kubeadm init --pod-network-cidr=192.168.0.0/16 |
Andy Bavier | a7c6a4e | 2018-09-28 13:29:43 -0700 | [diff] [blame] | 75 | mkdir -p $(HOME)/.kube |
| 76 | sudo cp -f /etc/kubernetes/admin.conf $(HOME)/.kube/config |
| 77 | sudo chown $(shell id -u):$(shell id -g) $(HOME)/.kube/config |
Zack Williams | 2a6a107 | 2019-01-07 11:15:12 -0700 | [diff] [blame] | 78 | kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml |
| 79 | kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 80 | kubectl taint nodes --all node-role.kubernetes.io/master- |
| 81 | touch $@ |
| 82 | |
| 83 | $(M)/helm-init: | $(M)/kubeadm /usr/local/bin/helm |
| 84 | kubectl create serviceaccount --namespace kube-system tiller |
| 85 | kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller |
| 86 | helm init --service-account tiller |
| 87 | until helm ls >& /dev/null; \ |
| 88 | do \ |
| 89 | echo "Waiting for Helm to be ready"; \ |
| 90 | sleep 5; \ |
| 91 | done |
Zack Williams | 3bcdc26 | 2018-09-27 11:00:38 -0700 | [diff] [blame] | 92 | helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 93 | helm repo add cord https://charts.opencord.org |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 94 | touch $@ |
| 95 | |
| 96 | $(WORKSPACE)/cord/helm-charts: | $(M)/setup |
| 97 | mkdir -p $(WORKSPACE)/cord |
| 98 | cd $(WORKSPACE)/cord; git clone https://gerrit.opencord.org/helm-charts |
| 99 | |
| 100 | $(M)/kafka: | $(WORKSPACE)/cord/helm-charts $(M)/helm-init |
Zack Williams | 3bcdc26 | 2018-09-27 11:00:38 -0700 | [diff] [blame] | 101 | cd $(WORKSPACE)/cord/helm-charts && \ |
| 102 | helm upgrade --install cord-kafka --version $(KAFKA_CHART_VERSION) -f examples/kafka-single.yaml incubator/kafka |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 103 | touch $@ |
| 104 | |
| 105 | $(M)/kafka-running: | $(M)/kafka |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 106 | kubectl wait $(KAFKA_POD) --for condition=Ready --timeout=180s |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 107 | touch $@ |
| 108 | |
Zack Williams | 3bcdc26 | 2018-09-27 11:00:38 -0700 | [diff] [blame] | 109 | $(M)/nem-monitoring: | $(M)/kafka-running |
| 110 | cd $(WORKSPACE)/cord/helm-charts && \ |
| 111 | helm dep up nem-monitoring && \ |
| 112 | helm upgrade --install nem-monitoring nem-monitoring |
| 113 | $(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh |
| 114 | touch $@ |
| 115 | |
| 116 | $(M)/logging: | $(M)/kafka-running |
| 117 | cd $(WORKSPACE)/cord/helm-charts && \ |
| 118 | helm dep up logging && \ |
| 119 | helm upgrade --install logging -f examples/logging-single.yaml logging |
| 120 | $(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh |
| 121 | touch $@ |
| 122 | |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 123 | # Dependency on NEM is there to force ordering for parallel install |
| 124 | # The idea is to install VOLTHA / ONOS / Mininet while NEM is initializing |
Zack Williams | 3bcdc26 | 2018-09-27 11:00:38 -0700 | [diff] [blame] | 125 | $(M)/onos: | $(M)/kafka-running $(M)/nem $(INFRA_PREREQS) |
Andy Bavier | b5651c7 | 2018-12-13 07:44:46 -0700 | [diff] [blame] | 126 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install onos onos -f $(SEBAVALUES) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 127 | touch $@ |
| 128 | |
Andy Bavier | 1e3e952 | 2018-11-06 11:12:00 -0700 | [diff] [blame] | 129 | $(M)/voltha: | $(M)/kafka-running $(INFRA_PREREQS) $(M)/etcd-operator-ready |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 130 | cd $(WORKSPACE)/cord/helm-charts; helm dep up voltha |
Andy Bavier | 1e3e952 | 2018-11-06 11:12:00 -0700 | [diff] [blame] | 131 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install voltha voltha -f $(SEBAVALUES) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 132 | touch $@ |
| 133 | |
Andy Bavier | 1e3e952 | 2018-11-06 11:12:00 -0700 | [diff] [blame] | 134 | $(M)/etcd-operator-ready: | $(WORKSPACE)/cord/helm-charts $(M)/helm-init |
| 135 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install etcd-operator stable/etcd-operator -f $(SEBAVALUES) |
| 136 | until kubectl get crd | grep etcdclusters; \ |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 137 | do \ |
Andy Bavier | 1e3e952 | 2018-11-06 11:12:00 -0700 | [diff] [blame] | 138 | echo "Waiting for etcdclusters CRD to be available"; \ |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 139 | sleep 5; \ |
| 140 | done |
| 141 | touch $@ |
| 142 | |
Andy Bavier | 1e3e952 | 2018-11-06 11:12:00 -0700 | [diff] [blame] | 143 | $(M)/voltha-running: | $(M)/voltha |
Kailash | bff9eb7 | 2018-11-16 13:03:59 -0800 | [diff] [blame] | 144 | timeout 300s bash -c "until kubectl get pod|grep etcd-cluster|grep 1/1; do echo 'Waiting for etcd-cluster to be ready'; sleep 10; done" |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 145 | $(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh voltha |
| 146 | touch $@ |
| 147 | |
| 148 | $(M)/ponsim: | $(M)/voltha |
| 149 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install ponnet ponnet |
| 150 | $(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh kube-system |
| 151 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install ponsimv2 ponsimv2 -f $(SEBAVALUES) |
| 152 | touch $@ |
| 153 | |
| 154 | $(M)/pon0_fwd: | $(M)/ponsim |
| 155 | echo 8 > /tmp/pon0_group_fwd_mask |
| 156 | until sudo cp /tmp/pon0_group_fwd_mask /sys/class/net/pon0/bridge/group_fwd_mask; \ |
| 157 | do \ |
| 158 | echo "waiting for pon0..."; \ |
| 159 | sleep 5; \ |
| 160 | done |
| 161 | rm /tmp/pon0_group_fwd_mask |
| 162 | touch $@ |
| 163 | |
| 164 | $(M)/mininet: | $(M)/onos $(M)/ponsim $(M)/pon0_fwd |
| 165 | sudo modprobe openvswitch |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 166 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install mininet mininet -f $(SEBAVALUES) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 167 | touch $@ |
| 168 | |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 169 | $(M)/nem: | $(M)/kafka-running $(INFRA_PREREQS) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 170 | cd $(WORKSPACE)/cord/helm-charts; helm dep update xos-core |
Andy Bavier | e5a16f6 | 2018-10-11 14:07:15 -0700 | [diff] [blame] | 171 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install xos-core xos-core -f $(SEBAVALUES) |
Matteo Scandolo | f3ceb4c | 2018-12-12 15:48:38 -0800 | [diff] [blame] | 172 | cd $(WORKSPACE)/cord/helm-charts; helm dep update xos-profiles/seba-services |
| 173 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install seba-services xos-profiles/seba-services -f $(SEBAVALUES) |
| 174 | cd $(WORKSPACE)/cord/helm-charts; helm dep update workflows/att-workflow |
| 175 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install att-workflow workflows/att-workflow -f $(SEBAVALUES) |
Andy Bavier | de4537d | 2018-11-29 11:48:25 -0700 | [diff] [blame] | 176 | cd $(WORKSPACE)/cord/helm-charts; helm dep update xos-profiles/base-kubernetes |
| 177 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install base-kubernetes xos-profiles/base-kubernetes -f $(SEBAVALUES) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 178 | touch $@ |
| 179 | |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 180 | $(M)/nem-running: | $(M)/nem |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 181 | $(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh |
| 182 | touch $@ |
| 183 | |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 184 | $(M)/ponsim-tosca: | $(M)/nem-running |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 185 | timeout 60s bash -c "until ! http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/serviceinstanceattributes|jq '.items[].backend_status'|grep -v OK; do echo 'waiting for ONOS config to sync'; sleep 5; done" |
| 186 | timeout 60s bash -c "until ! http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/onos/onosapps|jq '.items[].backend_status'|grep -v OK; do echo 'waiting for ONOS apps to sync'; sleep 5; done" |
Andy Bavier | 905ec80 | 2018-10-04 11:08:37 -0700 | [diff] [blame] | 187 | timeout 60s bash -c "until http -a karaf:karaf GET http://127.0.0.1:30120/onos/v1/applications/org.opencord.kafka|jq '.state'|grep -q ACTIVE; do echo 'Waiting for Kafka app to become ACTIVE'; sleep 5; done" |
Andy Bavier | e5a16f6 | 2018-10-11 14:07:15 -0700 | [diff] [blame] | 188 | cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install ponsim-pod xos-profiles/ponsim-pod -f $(SEBAVALUES) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 189 | $(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh |
| 190 | touch $@ |
| 191 | |
| 192 | $(M)/siab: | $(M)/voltha-running $(M)/mininet $(M)/ponsim-tosca |
| 193 | until http -a karaf:karaf --ignore-stdin --check-status GET http://127.0.0.1:30120/onos/v1/configuration/org.opencord.olt.impl.Olt; \ |
| 194 | do \ |
| 195 | sleep 5; \ |
| 196 | done |
| 197 | http -a karaf:karaf --ignore-stdin POST http://127.0.0.1:30120/onos/v1/configuration/org.opencord.olt.impl.Olt defaultVlan=65535 |
Andy Bavier | 905ec80 | 2018-10-04 11:08:37 -0700 | [diff] [blame] | 198 | timeout 1m bash -c "until http GET http://127.0.0.1:30125/health|jq '.state'|grep -q HEALTHY; do echo 'Waiting for VOLTHA to be HEALTHY'; sleep 10; done" |
| 199 | echo "[passed] VOLTHA is HEALTHY" |
| 200 | timeout 2m bash -c "until http GET http://127.0.0.1:30125/api/v1/devices|jq '.items[].admin_state'|grep ENABLED|wc -l|grep -q 2; do echo 'Waiting for OLT and ONU to be enabled in VOLTHA'; sleep 10; done" |
| 201 | echo "[passed] OLT and ONU are enabled in VOLTHA" |
| 202 | timeout 2m bash -c "until http -a karaf:karaf GET http://127.0.0.1:30120/onos/v1/devices|jq '.devices[].available'|grep true|wc -l|grep -q 2; do echo 'Waiting for VOLTHA logical device and agg switch to be available in ONOS'; sleep 10; done" |
| 203 | echo "[passed] VOLTHA logical device and agg switch are available in ONOS" |
| 204 | timeout 2m bash -c "until http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/att-workflow-driver/attworkflowdriverserviceinstances |jq '.items[0].authentication_state'|grep -q AWAITING; do echo 'waiting for ATT Workflow Driver ServiceInstance to be in AWAITING state'; sleep 10; done" |
| 205 | echo "[passed] ATT Workflow Driver ServiceInstance is in AWAITING state" |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 206 | touch $@ |
| 207 | echo "SEBA-in-a-Box installation finished!" |
| 208 | |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 209 | $(M)/seba-1.0.0: | $(WORKSPACE)/cord/helm-charts $(M)/helm-init |
| 210 | helm install -n cord-platform cord/cord-platform --version=6.1.0 -f $(WORKSPACE)/cord/helm-charts/$(SEBAVALUES) |
| 211 | until kubectl get crd | grep etcdclusters; \ |
| 212 | do \ |
| 213 | echo "Waiting for etcdclusters CRD to be available"; \ |
| 214 | sleep 5; \ |
| 215 | done |
| 216 | touch $(M)/kafka |
| 217 | touch $(M)/onos |
| 218 | touch $(M)/etcd-operator-ready |
| 219 | helm install -n seba cord/seba --version=1.0.0 -f $(WORKSPACE)/cord/helm-charts/$(SEBAVALUES) |
| 220 | helm install -n att-workflow cord/att-workflow --version=1.0.2 -f $(WORKSPACE)/cord/helm-charts/$(SEBAVALUES) |
| 221 | touch $(M)/voltha |
| 222 | touch $(M)/nem |
| 223 | touch $@ |
| 224 | |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 225 | # BBSim support |
| 226 | BBSIM_OLT_TOSCA ?= examples/bbsim-16.yaml |
| 227 | BBSIM_DHCP_TOSCA ?= examples/bbsim-dhcp.yaml |
| 228 | |
| 229 | $(M)/bbsim: | $(M)/onos $(M)/voltha-running $(M)/nem-running |
| 230 | cd $(WORKSPACE)/cord/helm-charts && \ |
| 231 | helm upgrade --install bbsim bbsim -f $(SEBAVALUES) && \ |
| 232 | scripts/wait_for_pods.sh voltha && \ |
| 233 | touch $@ |
| 234 | |
| 235 | $(M)/bbsim-tosca: | $(M)/bbsim |
| 236 | cd $(WORKSPACE)/cord/helm-charts && \ |
| 237 | echo "Loading BBSim TOSCA: $(BBSIM_DHCP_TOSCA) $(BBSIM_OLT_TOSCA)" && \ |
| 238 | for tosca in $(BBSIM_DHCP_TOSCA) $(BBSIM_OLT_TOSCA) ; do \ |
| 239 | curl -H "xos-username: admin@opencord.org" -H "xos-password: letmein" -X POST --data-binary @$$tosca http://127.0.0.1:30007/run ; \ |
| 240 | done && \ |
| 241 | touch $@ |
| 242 | |
| 243 | run-tests: | $(M)/qatests |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 244 | |
Andy Bavier | 0144993 | 2018-10-01 16:19:40 -0700 | [diff] [blame] | 245 | $(M)/qatests-prereqs: |
| 246 | sudo apt install -y python-pip virtualenv |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 247 | touch $@ |
| 248 | |
Andy Bavier | 0144993 | 2018-10-01 16:19:40 -0700 | [diff] [blame] | 249 | $(WORKSPACE)/cord/test/cord-tester: | $(M)/setup |
| 250 | mkdir -p $(WORKSPACE)/cord/test |
| 251 | cd $(WORKSPACE)/cord/test && git clone https://gerrit.opencord.org/cord-tester |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 252 | |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 253 | PYBOT_ARGS ?= |
| 254 | $(M)/qatests: | $(M)/siab $(M)/qatests-prereqs $(WORKSPACE)/cord/test/cord-tester |
Andy Bavier | 0144993 | 2018-10-01 16:19:40 -0700 | [diff] [blame] | 255 | cd $(WORKSPACE)/cord/test/cord-tester/src/test/cord-api/ && \ |
Andy Bavier | 6ce277e | 2018-10-02 10:29:21 -0700 | [diff] [blame] | 256 | WORKSPACE=$(VIRTUALENV) bash ./setup_venv.sh && \ |
| 257 | source $(VIRTUALENV)/venv-cord-tester/bin/activate && \ |
Andy Bavier | 0144993 | 2018-10-01 16:19:40 -0700 | [diff] [blame] | 258 | cd Tests/WorkflowValidations/ && \ |
Kailash | 48e7a3f | 2018-12-06 12:31:32 -0800 | [diff] [blame] | 259 | robot $(PYBOT_ARGS) --removekeywords wuks -e notready -i $(TESTTAGS) SIAB.robot |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 260 | touch $@ |
| 261 | |
| 262 | remove-chart-milestones: |
| 263 | cd $(M); rm -f kafka kafka-running onos voltha etcd-operator-ready etcd-cluster \ |
Zack Williams | d0c12f0 | 2018-11-21 11:54:36 -0700 | [diff] [blame] | 264 | voltha-running ponsim mininet nem nem-running ponsim-tosca siab bbsim bbsim-tosca \ |
Andy Bavier | 1d5b992 | 2019-01-02 15:30:55 -0700 | [diff] [blame] | 265 | logging nem-monitoring seba-1.0.0 |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 266 | |
| 267 | remove-kube-milestones: |
| 268 | cd $(M); rm -f kubeadm helm-init |
| 269 | |
| 270 | remove-test-milestones: |
Kailash | f8ff812 | 2018-12-03 10:44:06 -0800 | [diff] [blame] | 271 | cd $(M); rm -f qatests qatests-prereqs |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 272 | |
| 273 | teardown-charts: remove-chart-milestones |
Matteo Scandolo | 0efb325 | 2018-12-10 15:58:45 -0800 | [diff] [blame] | 274 | helm delete --purge $(shell helm ls -q | grep -v docker-registry) |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 275 | |
Kailash | f8ff812 | 2018-12-03 10:44:06 -0800 | [diff] [blame] | 276 | reset-kubeadm: remove-chart-milestones remove-kube-milestones remove-test-milestones |
Andy Bavier | c3a0269 | 2018-09-26 15:55:23 -0700 | [diff] [blame] | 277 | sudo kubeadm reset -f |
Andy Bavier | 35053b6 | 2018-09-20 13:45:45 -0700 | [diff] [blame] | 278 | sudo iptables -F && sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -X |
| 279 | |