mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
Add test case to verify imgpkg in nightly
Signed-off-by: Yang Jiao <jiaoya@vmware.com>
This commit is contained in:
parent
2d6973febf
commit
d7f53e51a9
@ -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}
|
||||
|
27
tests/robot-cases/Group0-Util/prepare_imgpkg_test_files.sh
Executable file
27
tests/robot-cases/Group0-Util/prepare_imgpkg_test_files.sh
Executable 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
|
@ -841,3 +841,20 @@ Test Case - WASM Push And Pull To Harbor
|
||||
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
|
||||
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user