[VOL-1953] Splitting the VOLTHA related config from the environment
config
Change-Id: Ib5b7953adb25bfce42ef7fdfb233ebb84ffdeb97
diff --git a/Jenkinsfile-voltha-build b/Jenkinsfile-voltha-build
index 05cedb5..3209920 100644
--- a/Jenkinsfile-voltha-build
+++ b/Jenkinsfile-voltha-build
@@ -16,18 +16,22 @@
timeout (100) {
try {
stage ("Parse deployment configuration file") {
- sh returnStdout: true, script: "rm -rf helm-repo-tools ${configBaseDir} voltha-system-tests"
+ sh returnStdout: true, script: "rm -rf helm-repo-tools ${configBaseDir} voltha-system-tests kind-voltha"
sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/helm-repo-tools"
sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/${configBaseDir}"
sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/voltha-system-tests"
+ sh returnStdout: true, script: "git clone https://github.com/ciena/kind-voltha.git"
deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
}
stage('Clean up') {
- timeout(10) {
+ timeout(10) {
sh returnStdout: true, script: """
export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
- cd kind-voltha/
- DEPLOY_K8S=no ./voltha down
+ for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet');
+ do
+ echo "Purging chart: \${hchart}"
+ helm delete --purge "\${hchart}"
+ done
"""
timeout(5) {
waitUntil {
@@ -116,25 +120,51 @@
}
}
}
- if ( params.configurePod ) {
- stage('Configure ONOS Netcfg') {
- timeout(1) {
- sh returnStdout: true, script: """
- curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-onos-netcfg.json
- curl -sSL --user karaf:karaf -X POST http://${deployment_config.nodes[0].ip}:30120/onos/v1/applications/org.onosproject.segmentrouting/active
- """
- }
+ if ( deployment_config.fabric_switches.size() > 0 ) {
+ stage('Configure ONOS') {
+ timeout(1) {
+ netcfg_out = sh returnStatus: true, script: """
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/${configBaseDir}/${configToscaDir}/voltha/${configFileName}-onos-netcfg-switch.json
+ curl -sSL --user karaf:karaf -X POST http://${deployment_config.nodes[0].ip}:30120/onos/v1/applications/org.onosproject.segmentrouting/active
+ """
+ return netcfg_out == 0
}
+ timeout(1) {
+ // FIXME iterate over the hosts section to create multiple xconnect if needed
+ // FIXME read the device id from deployment_config.fabric_switches
+ xconnect_out = sh returnStatus: true, script: """
+ curl -X POST --user karaf:karaf --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"deviceId": "of:0000000000000001", "vlanId": "111", "ports": [3,10]}' 'http://10.192.20.45:30120/onos/segmentrouting/xconnect'
+ """
+ return xconnect_out == 0
+ }
+ }
+ }
+ if ( params.configurePod ) {
stage('Push Tech-Profile') {
timeout(1) {
- sh returnStdout: true, script: """
+ out_push_tp = sh returnStatus: true, script: """
export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
etcd_container=\$(kubectl get pods -n voltha | grep voltha-etcd-cluster | awk 'NR==1{print \$1}')
kubectl cp /home/cord/voltha-system-tests/tests/data/${configFileName}-${profile}.json voltha/\$etcd_container:/tmp/flexpod.json
put_result=\$(kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/xgspon/64')
- get_result=\$(kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/xgspon/64')
"""
+ return out_push_tp == 0
}
+ timeout(1) {
+ out_get_tp = sh returnStatus: true, script: """
+ etcd_container=\$(kubectl get pods -n voltha | grep voltha-etcd-cluster | awk 'NR==1{print \$1}')
+ get_result=\$(kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/xgspon/64')
+ """
+ return out_get_tp == 0
+ }
+ }
+ stage('Push Sadis-config') {
+ timeout(1) {
+ sadis_out = sh returnStatus: true, script: """
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis.json
+ """
+ return sadis_out == 0
+ }
}
}
currentBuild.result = 'SUCCESS'
@@ -146,4 +176,3 @@
echo "RESULT: ${currentBuild.result}"
}
}
-
diff --git a/Jenkinsfile-voltha-test b/Jenkinsfile-voltha-test
index 906000f..3aa6c99 100644
--- a/Jenkinsfile-voltha-test
+++ b/Jenkinsfile-voltha-test
@@ -24,10 +24,10 @@
timeout(2) {
sh returnStdout: true, script: """
rm -rf helm-charts cord-tester voltha voltha-system-tests
- git clone -b ${branch} ${cordRepoUrl}/helm-charts
+ git clone -b ${branch} ${cordRepoUrl}/helm-charts # NOTE do we need helm-charts?
git clone -b ${branch} ${cordRepoUrl}/cord-tester
git clone -b ${branch} ${cordRepoUrl}/voltha-system-tests
- git clone -b ${branch} ${cordRepoUrl}/voltha
+ git clone -b ${branch} ${cordRepoUrl}/voltha # NOTE do we need the voltha source code??
"""
}
}
diff --git a/libraries/onos.robot b/libraries/onos.robot
index a5147db..315dc8b 100644
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -37,6 +37,7 @@
[Return] ${output}
Validate OLT Device in ONOS
+# FIXME use volt-olts to check that the OLT is ONOS
[Arguments] ${serial_number}
[Documentation] Checks if olt has been connected to ONOS
${resp}= Get Request ONOS onos/v1/devices
diff --git a/tests/Voltha_PODTests.robot b/tests/Voltha_PODTests.robot
index 6d1949d..a333310 100644
--- a/tests/Voltha_PODTests.robot
+++ b/tests/Voltha_PODTests.robot
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# FIXME Can we use the same test against BBSim and Hardware?
+
*** Settings ***
Documentation Test various end-to-end scenarios
Suite Setup Setup Suite