diff --git a/jenkins/mgmt/sonic-mgmt-canary/Jenkinsfile b/jenkins/mgmt/sonic-mgmt-canary/Jenkinsfile index 05856e4f93e8..6949496548bf 100644 --- a/jenkins/mgmt/sonic-mgmt-canary/Jenkinsfile +++ b/jenkins/mgmt/sonic-mgmt-canary/Jenkinsfile @@ -19,8 +19,7 @@ pipeline { branches: [[name: '*/master']], userRemoteConfigs: [[url: 'https://github.com/Azure/sonic-mgmt']]]) } - copyArtifacts(projectName: 'bldenv/docker-sonic-mgmt', filter: '**/docker-sonic-mgmt.gz', target: 'mgmt', flatten: true) - copyArtifacts(projectName: 'vs/buildimage-vs-image', filter: '**/sonic-vs.img.gz', target: 'vsimage', flatten: true) + copyArtifacts(projectName: 'vs/buildimage-vs-image', filter: '**/sonic-vs.img.gz', target: 'target', flatten: true) } } @@ -30,7 +29,7 @@ pipeline { lock(resource: "kvmtest_${env.NODE_NAME}") { withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'VM_USER_PRIVATE_KEY'), \ usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) { - sh './scripts/mgmt/test.sh' + sh './scripts/vs/buildimage-vs-image/test.sh' } } } diff --git a/jenkins/mgmt/sonic-mgmt-pr/Jenkinsfile b/jenkins/mgmt/sonic-mgmt-pr/Jenkinsfile index e4f4111c4c55..c9c7b178cc4f 100644 --- a/jenkins/mgmt/sonic-mgmt-pr/Jenkinsfile +++ b/jenkins/mgmt/sonic-mgmt-pr/Jenkinsfile @@ -16,8 +16,7 @@ pipeline { userRemoteConfigs: [[url: 'https://github.com/Azure/sonic-mgmt', refspec: '+refs/pull/*:refs/remotes/origin/pr/*']]]) } - copyArtifacts(projectName: 'bldenv/docker-sonic-mgmt', filter: '**/docker-sonic-mgmt.gz', target: 'mgmt', flatten: true) - copyArtifacts(projectName: 'vs/buildimage-vs-image', filter: '**/sonic-vs.img.gz', target: 'vsimage', flatten: true) + copyArtifacts(projectName: 'vs/buildimage-vs-image', filter: '**/sonic-vs.img.gz', target: 'target', flatten: true) } } @@ -27,7 +26,7 @@ pipeline { lock(resource: "kvmtest_${env.NODE_NAME}") { withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'VM_USER_PRIVATE_KEY'), \ usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) { - sh './scripts/mgmt/test.sh' + sh './scripts/vs/buildimage-vs-image/test.sh' } } } diff --git a/jenkins/vs/buildimage-vs-image-201911-test/Jenkinsfile b/jenkins/vs/buildimage-vs-image-201911-test/Jenkinsfile index 00520d3ac91b..13e6ac88809f 100644 --- a/jenkins/vs/buildimage-vs-image-201911-test/Jenkinsfile +++ b/jenkins/vs/buildimage-vs-image-201911-test/Jenkinsfile @@ -52,7 +52,7 @@ pipeline { steps { wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { lock(resource: "kvmtest_${env.NODE_NAME}") { - withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'PRIVATE_KEY'), \ + withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'VM_USER_PRIVATE_KEY'), \ usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) { sh './scripts/vs/buildimage-vs-image/test.sh' } diff --git a/jenkins/vs/buildimage-vs-image-pr/Jenkinsfile b/jenkins/vs/buildimage-vs-image-pr/Jenkinsfile index 5b76d101e62b..4ecc280c2454 100644 --- a/jenkins/vs/buildimage-vs-image-pr/Jenkinsfile +++ b/jenkins/vs/buildimage-vs-image-pr/Jenkinsfile @@ -73,7 +73,7 @@ sudo cp ../target/sonic-vs.bin /nfs/jenkins/sonic-vs-${JOB_NAME##*/}.${BUILD_NUM wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { lock(resource: "kvmtest_${env.NODE_NAME}") { - withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'PRIVATE_KEY'), \ + withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'VM_USER_PRIVATE_KEY'), \ usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) { sh './scripts/vs/buildimage-vs-image/build_kvm_image.sh' sh './scripts/vs/buildimage-vs-image/test.sh' diff --git a/jenkins/vs/buildimage-vs-image-test/Jenkinsfile b/jenkins/vs/buildimage-vs-image-test/Jenkinsfile index ee59c38fcd8f..369d497b0d24 100644 --- a/jenkins/vs/buildimage-vs-image-test/Jenkinsfile +++ b/jenkins/vs/buildimage-vs-image-test/Jenkinsfile @@ -52,7 +52,7 @@ pipeline { steps { wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { lock(resource: "kvmtest_${env.NODE_NAME}") { - withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'PRIVATE_KEY'), \ + withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'VM_USER_PRIVATE_KEY'), \ usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) { sh './scripts/vs/buildimage-vs-image/test.sh' } diff --git a/jenkins/vs/buildimage-vs-image/Jenkinsfile b/jenkins/vs/buildimage-vs-image/Jenkinsfile index 907231f941df..d984a74577f3 100644 --- a/jenkins/vs/buildimage-vs-image/Jenkinsfile +++ b/jenkins/vs/buildimage-vs-image/Jenkinsfile @@ -86,7 +86,7 @@ sudo cp ../target/sonic-vs-dbg.bin /nfs/jenkins/sonic-vs-dbg-${JOB_NAME##*/}.${B wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) { lock(resource: "kvmtest_${env.NODE_NAME}") { - withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'PRIVATE_KEY'), \ + withCredentials([sshUserPrivateKey(credentialsId: '2b6b6afe-4892-41d1-967c-d683e7773727', keyFileVariable: 'VM_USER_PRIVATE_KEY'), \ usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) { sh './scripts/vs/buildimage-vs-image/build_kvm_image.sh' sh './scripts/vs/buildimage-vs-image/test.sh' diff --git a/scripts/mgmt/test.sh b/scripts/mgmt/test.sh deleted file mode 100755 index d167ca6fc39a..000000000000 --- a/scripts/mgmt/test.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -xe - -echo ${JOB_NAME##*/}.${BUILD_NUMBER} - -tbname=vms-kvm-t0 - -docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWD sonicdev-microsoft.azurecr.io:443 -docker pull sonicdev-microsoft.azurecr.io:443/docker-sonic-mgmt:latest - -cat $VM_USER_PRIVATE_KEY > pkey.txt - -ls -l vsimage - -mkdir -p $HOME/sonic-vm/images -cp vsimage/sonic-vs.img.gz $HOME/sonic-vm/images/ -gzip -fd $HOME/sonic-vm/images/sonic-vs.img.gz - -ls -l $HOME/sonic-vm/images - -pushd sonic-mgmt/ansible -sed -i s:use_own_value:johnar: veos.vtb -echo abc > password.txt -popd - -docker run --rm=true -v $(pwd):/data -w /data -i sonicdev-microsoft.azurecr.io:443/docker-sonic-mgmt ./scripts/vs/buildimage-vs-image/runtest.sh $tbname diff --git a/scripts/vs/buildimage-vs-image/test.sh b/scripts/vs/buildimage-vs-image/test.sh index fd3e603f4eda..fbf939d4491e 100755 --- a/scripts/vs/buildimage-vs-image/test.sh +++ b/scripts/vs/buildimage-vs-image/test.sh @@ -11,7 +11,7 @@ dut=vlab-01 docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWD sonicdev-microsoft.azurecr.io:443 docker pull sonicdev-microsoft.azurecr.io:443/docker-sonic-mgmt:latest -cat $PRIVATE_KEY > pkey.txt +cat $VM_USER_PRIVATE_KEY > pkey.txt mkdir -p $HOME/sonic-vm/images if [ -e target/sonic-vs.img.gz ]; then