mirror of
https://github.com/goharbor/harbor
synced 2025-04-15 07:09:20 +00:00
fix cross mount conformance test (#15274)
fixes #15273 set the cross mount namespace for conformance test, the default vaule cannot pass the reponame validation. Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
parent
b158086642
commit
cdb7f4514e
|
@ -3,11 +3,17 @@ set -e
|
||||||
echo "get the conformance testing code..."
|
echo "get the conformance testing code..."
|
||||||
git clone https://github.com/opencontainers/distribution-spec.git
|
git clone https://github.com/opencontainers/distribution-spec.git
|
||||||
|
|
||||||
echo "create testing project"
|
function createPro {
|
||||||
STATUS=$(curl -w '%{http_code}' -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST -u "admin:Harbor12345" -s --insecure "https://$IP/api/v2.0/projects" --data '{"project_name":"conformance","metadata":{"public":"false"},"storage_limit":-1}')
|
echo "create testing project: $2"
|
||||||
if [ $STATUS -ne 201 ]; then
|
STATUS=$(curl -w '%{http_code}' -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST -u "admin:Harbor12345" -s --insecure "https://$1/api/v2.0/projects" --data "{\"project_name\":\"$2\",\"metadata\":{\"public\":\"false\"},\"storage_limit\":-1}")
|
||||||
exit 1
|
if [ $STATUS -ne 201 ]; then
|
||||||
fi
|
echo "fail to create project: $2, rc: $STATUS"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
createPro $1 conformance
|
||||||
|
createPro $1 crossmount
|
||||||
|
|
||||||
echo "run conformance test..."
|
echo "run conformance test..."
|
||||||
export OCI_ROOT_URL="https://$1"
|
export OCI_ROOT_URL="https://$1"
|
||||||
|
@ -20,6 +26,7 @@ export OCI_TEST_PUSH=1
|
||||||
export OCI_TEST_PULL=1
|
export OCI_TEST_PULL=1
|
||||||
export OCI_TEST_CONTENT_DISCOVERY=1
|
export OCI_TEST_CONTENT_DISCOVERY=1
|
||||||
export OCI_TEST_CONTENT_MANAGEMENT=1
|
export OCI_TEST_CONTENT_MANAGEMENT=1
|
||||||
|
export OCI_CROSSMOUNT_NAMESPACE="crossmount/testrepo"
|
||||||
|
|
||||||
cd ./distribution-spec/conformance
|
cd ./distribution-spec/conformance
|
||||||
go test .
|
go test .
|
Loading…
Reference in New Issue
Block a user