Add test case to verify imgpkg in nightly

Signed-off-by: Yang Jiao <jiaoya@vmware.com>
This commit is contained in:
Yang Jiao 2021-11-01 11:27:52 +08:00
parent 2d6973febf
commit d7f53e51a9
5 changed files with 53 additions and 1 deletions

View File

@ -459,3 +459,7 @@ Check Harbor Api Page
${Title}= Get Title
Should Be Equal ${Title} Harbor Swagger
Retry Wait Element xpath=//h2[contains(.,"Harbor API")]
Prepare Image Package Test Files
[Arguments] ${files_path}
${rc} ${output}= Run And Return Rc And Output bash tests/robot-cases/Group0-Util/prepare_imgpkg_test_files.sh ${files_path}

View File

@ -0,0 +1,27 @@
#!/bin/bash
set -x
set -e
FILE_DIRECTORY=$1
FILE_PATH=$FILE_DIRECTORY/.imgpkg
mkdir "$FILE_DIRECTORY"
mkdir "$FILE_PATH"
cat > "$FILE_PATH"/bundle.yml <<EOF
---
apiVersion: imgpkg.carvel.dev/v1alpha1
kind: Bundle
metadata:
name: my-app
authors:
- name: blah
email: blah@blah.com
websites:
- url: blah.com
EOF
cat > "$FILE_PATH"/images.yml <<EOF
---
apiVersion: imgpkg.carvel.dev/v1alpha1
kind: ImagesLock
EOF

View File

@ -840,4 +840,21 @@ Test Case - WASM Push And Pull To Harbor
Wait Unitl Command Success wasm-to-oci push hello.wasm ${ip}/project${d}/wasm-to-oci:v1
Wait Unitl Command Success wasm-to-oci pull ${ip}/project${d}/wasm-to-oci:v1 --out test.wasm
Wait Unitl Command Success docker logout ${ip}
Retry file should exist test.wasm
Retry file should exist test.wasm
Test Case - Carvel Imgpkg Push And Pull To Harbor
[Tags] imgpkg_push_and_pull
Init Chrome Driver
${user}= Set Variable user004
${pwd}= Set Variable Test1@34
${out_path}= Set Variable /tmp/my-bundle
Sign In Harbor ${HARBOR_URL} ${user} ${pwd}
${d}= Get Current Date result_format=%m%s
Create An New Project And Go Into Project project${d}
Prepare Image Package Test Files ${EXECDIR}/config
Wait Unitl Command Success docker login -u ${user} -p ${pwd} ${ip}
Wait Unitl Command Success imgpkg push -b ${ip}/project${d}/my-bundle:v1.0.0 -f config/
Wait Unitl Command Success imgpkg pull -b ${ip}/project${d}/my-bundle:v1.0.0 -o ${out_path}
Wait Unitl Command Success docker logout ${ip}
Retry File Should Exist ${out_path}/.imgpkg/bundle.yml
Retry File Should Exist ${out_path}/.imgpkg/images.yml

View File

@ -65,6 +65,9 @@ RUN pwd && mkdir /tool/binary && \
# Install wasm-to-oci
WASM_TO_OCI_VERSION=0.1.2 && wget https://github.com/engineerd/wasm-to-oci/releases/download/v${WASM_TO_OCI_VERSION}/linux-amd64-wasm-to-oci && \
chmod +x linux-amd64-wasm-to-oci && mv linux-amd64-wasm-to-oci /tool/binary/wasm-to-oci && \
# Install imgpkg
IMGPKG_VERSION=0.22.0 && wget https://github.com/vmware-tanzu/carvel-imgpkg/releases/download/v$IMGPKG_VERSION/imgpkg-linux-amd64 && \
mv imgpkg-linux-amd64 /tool/binary/imgpkg && chmod +x /tool/binary/imgpkg && \
pwd
#ubuntu

View File

@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
tar \
unzip \
gzip \
jq \
# certutil
libnss3-tools \
google-chrome-stable