Skip to content

Commit

Permalink
[kvm] Combine mgmt and buildimage KVM test scripts (sonic-net#118)
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Allen <daall@microsoft.com>
  • Loading branch information
daall authored Jun 23, 2020
1 parent 90620c5 commit 537e726
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 36 deletions.
5 changes: 2 additions & 3 deletions jenkins/mgmt/sonic-mgmt-canary/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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'
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions jenkins/mgmt/sonic-mgmt-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jenkins/vs/buildimage-vs-image-201911-test/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
2 changes: 1 addition & 1 deletion jenkins/vs/buildimage-vs-image-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion jenkins/vs/buildimage-vs-image-test/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
2 changes: 1 addition & 1 deletion jenkins/vs/buildimage-vs-image/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
25 changes: 0 additions & 25 deletions scripts/mgmt/test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/vs/buildimage-vs-image/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 537e726

Please sign in to comment.