Skip to content

Commit 73eef25

Browse files
authored
ci: enable fips140 blackbox test (#3460)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
1 parent b2bbbb2 commit 73eef25

5 files changed

Lines changed: 18 additions & 9 deletions

File tree

test/blackbox/ci.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ${SCRIPTPATH}/setup_images.sh
1414
tests=("pushpull" "pushpull_authn" "delete_images" "referrers" "metadata" "anonymous_policy"
1515
"annotations" "detect_manifest_collision" "cve" "sync" "sync_docker" "sync_replica_cluster"
1616
"scrub" "garbage_collect" "metrics" "metrics_minimal" "multiarch_index" "docker_compat" "redis_local" "redis_session_store"
17-
"events_nats" "events_http" "events_nats_lint_failure" "events_http_lint_failure" "events_sink_failure" "events_config_decoding")
17+
"events_nats" "events_http" "events_nats_lint_failure" "events_http_lint_failure" "events_sink_failure" "events_config_decoding"
18+
"fips140")
1819

1920
for test in ${tests[*]}; do
2021
${BATS} ${BATS_FLAGS} ${SCRIPTPATH}/${test}.bats > ${test}.log & pids+=($!)

test/blackbox/fips140.bats

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ function setup_file() {
2929
# Setup zot server
3030
local zot_root_dir=${BATS_FILE_TMPDIR}/zot
3131
local zot_config_file=${BATS_FILE_TMPDIR}/zot_config.json
32+
ZOT_LOG_FILE=${zot_root_dir}/zot-log.json
3233
local oci_data_dir=${BATS_FILE_TMPDIR}/oci
3334
mkdir -p ${zot_root_dir}
3435
mkdir -p ${oci_data_dir}
3536
zot_port=$(get_free_port_for_service "zot")
3637
echo ${zot_port} > ${BATS_FILE_TMPDIR}/zot.port
38+
touch ${ZOT_LOG_FILE}
3739
cat > ${zot_config_file}<<EOF
3840
{
3941
"distSpecVersion": "1.1.1",
@@ -46,7 +48,7 @@ function setup_file() {
4648
},
4749
"log": {
4850
"level": "debug",
49-
"output": "${BATS_FILE_TMPDIR}/zot.log"
51+
"output": "${ZOT_LOG_FILE}"
5052
}
5153
}
5254
EOF
@@ -59,7 +61,7 @@ EOF
5961

6062
function teardown() {
6163
# conditionally printing on failure is possible from teardown but not from from teardown_file
62-
cat ${BATS_FILE_TMPDIR}/zot.log
64+
cat ${BATS_FILE_TMPDIR}/zot/zot-log.json
6365
}
6466

6567
function teardown_file() {

test/blackbox/helpers_scrub.bash

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ function delete_blob() {
1414
ls -al ${zot_test_files}/blobs/sha256/
1515
}
1616

17-
function log_output() {
18-
local zot_log_file=${BATS_FILE_TMPDIR}/zot/zot-log.json
19-
cat ${zot_log_file} | jq ' .["message"] '
20-
}
21-
2217
function affected() {
2318
log_output | jq 'contains("blobs/manifest affected")?' | grep true
2419
}

test/blackbox/helpers_zot.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,8 @@ function zb_run() {
5454
local zot_address=${1}
5555
${ZB_PATH} -c 10 -n 30 -o stdout ${zot_address} --skip-cleanup
5656
}
57+
58+
function log_output() {
59+
local zot_log_file=${BATS_FILE_TMPDIR}/zot/zot-log.json
60+
cat ${zot_log_file} | jq ' .["message"] '
61+
}

test/ports.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,5 +402,11 @@
402402
"begin": 11420,
403403
"end": 11429
404404
}
405+
},
406+
"blackbox/fips140.bats": {
407+
"zot": {
408+
"begin": 11430,
409+
"end": 11439
410+
}
405411
}
406-
}
412+
}

0 commit comments

Comments
 (0)