From 5afc0b5d28b48e8d706cc162d59cda49d1670109 Mon Sep 17 00:00:00 2001 From: wangyan Date: Mon, 18 Sep 2017 15:46:40 +0800 Subject: [PATCH] update notary case --- tests/robot-cases/Group0-BAT/BAT.robot | 1 - .../Group9-Content-trust/notary-push-image.sh | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/robot-cases/Group0-BAT/BAT.robot b/tests/robot-cases/Group0-BAT/BAT.robot index 5a75ef029..36b6033d9 100644 --- a/tests/robot-cases/Group0-BAT/BAT.robot +++ b/tests/robot-cases/Group0-BAT/BAT.robot @@ -300,7 +300,6 @@ Test Case - Admin Push Signed Image Log To Console ${output} Push image ${ip} %{HARBOR_ADMIN} %{HARBOR_PASSWORD} library hello-world:latest - ${rc} ${output}= Run And Return Rc And Output ./tests/robot-cases/Group9-Content-trust/notary-push-image.sh Log To Console ${output} Should Be Equal As Integers ${rc} 0 diff --git a/tests/robot-cases/Group9-Content-trust/notary-push-image.sh b/tests/robot-cases/Group9-Content-trust/notary-push-image.sh index 975653ad8..3c4849829 100755 --- a/tests/robot-cases/Group9-Content-trust/notary-push-image.sh +++ b/tests/robot-cases/Group9-Content-trust/notary-push-image.sh @@ -1,12 +1,24 @@ #!/bin/bash -docker pull tomcat +docker pull tomcat:latest IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'` +PASSHRASE='Harbor12345' + +echo $IP + export DOCKER_CONTENT_TRUST=1 export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443 -docker login -u admin -p Harbor12345 $IP +export NOTARY_ROOT_PASSPHRASE=$PASSHRASE +export NOTARY_TARGETS_PASSPHRASE=$PASSHRASE +export NOTARY_SNAPSHOT_PASSPHRASE=$PASSHRASE +export DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE=$PASSHRASE +export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$PASSHRASE +export DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE=$PASSHRASE +export DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE=$PASSHRASE +docker login -u admin -p Harbor12345 $IP docker tag tomcat $IP/library/tomcat:latest -python ./tests/robot-cases/Group9-Content-trust/notary-push-image.py +docker push $IP/library/tomcat:latest +