mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
ci: enable fips140 blackbox test (#3460)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b2bbbb27f2
commit
73eef25681
+2
-1
@@ -14,7 +14,8 @@ ${SCRIPTPATH}/setup_images.sh
|
||||
tests=("pushpull" "pushpull_authn" "delete_images" "referrers" "metadata" "anonymous_policy"
|
||||
"annotations" "detect_manifest_collision" "cve" "sync" "sync_docker" "sync_replica_cluster"
|
||||
"scrub" "garbage_collect" "metrics" "metrics_minimal" "multiarch_index" "docker_compat" "redis_local" "redis_session_store"
|
||||
"events_nats" "events_http" "events_nats_lint_failure" "events_http_lint_failure" "events_sink_failure" "events_config_decoding")
|
||||
"events_nats" "events_http" "events_nats_lint_failure" "events_http_lint_failure" "events_sink_failure" "events_config_decoding"
|
||||
"fips140")
|
||||
|
||||
for test in ${tests[*]}; do
|
||||
${BATS} ${BATS_FLAGS} ${SCRIPTPATH}/${test}.bats > ${test}.log & pids+=($!)
|
||||
|
||||
@@ -29,11 +29,13 @@ function setup_file() {
|
||||
# Setup zot server
|
||||
local zot_root_dir=${BATS_FILE_TMPDIR}/zot
|
||||
local zot_config_file=${BATS_FILE_TMPDIR}/zot_config.json
|
||||
ZOT_LOG_FILE=${zot_root_dir}/zot-log.json
|
||||
local oci_data_dir=${BATS_FILE_TMPDIR}/oci
|
||||
mkdir -p ${zot_root_dir}
|
||||
mkdir -p ${oci_data_dir}
|
||||
zot_port=$(get_free_port_for_service "zot")
|
||||
echo ${zot_port} > ${BATS_FILE_TMPDIR}/zot.port
|
||||
touch ${ZOT_LOG_FILE}
|
||||
cat > ${zot_config_file}<<EOF
|
||||
{
|
||||
"distSpecVersion": "1.1.1",
|
||||
@@ -46,7 +48,7 @@ function setup_file() {
|
||||
},
|
||||
"log": {
|
||||
"level": "debug",
|
||||
"output": "${BATS_FILE_TMPDIR}/zot.log"
|
||||
"output": "${ZOT_LOG_FILE}"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
@@ -59,7 +61,7 @@ EOF
|
||||
|
||||
function teardown() {
|
||||
# conditionally printing on failure is possible from teardown but not from from teardown_file
|
||||
cat ${BATS_FILE_TMPDIR}/zot.log
|
||||
cat ${BATS_FILE_TMPDIR}/zot/zot-log.json
|
||||
}
|
||||
|
||||
function teardown_file() {
|
||||
|
||||
@@ -14,11 +14,6 @@ function delete_blob() {
|
||||
ls -al ${zot_test_files}/blobs/sha256/
|
||||
}
|
||||
|
||||
function log_output() {
|
||||
local zot_log_file=${BATS_FILE_TMPDIR}/zot/zot-log.json
|
||||
cat ${zot_log_file} | jq ' .["message"] '
|
||||
}
|
||||
|
||||
function affected() {
|
||||
log_output | jq 'contains("blobs/manifest affected")?' | grep true
|
||||
}
|
||||
|
||||
@@ -54,3 +54,8 @@ function zb_run() {
|
||||
local zot_address=${1}
|
||||
${ZB_PATH} -c 10 -n 30 -o stdout ${zot_address} --skip-cleanup
|
||||
}
|
||||
|
||||
function log_output() {
|
||||
local zot_log_file=${BATS_FILE_TMPDIR}/zot/zot-log.json
|
||||
cat ${zot_log_file} | jq ' .["message"] '
|
||||
}
|
||||
|
||||
+7
-1
@@ -402,5 +402,11 @@
|
||||
"begin": 11420,
|
||||
"end": 11429
|
||||
}
|
||||
},
|
||||
"blackbox/fips140.bats": {
|
||||
"zot": {
|
||||
"begin": 11430,
|
||||
"end": 11439
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user