Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/linux/test-vibeshine-drm-build-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ relative_call=$(sed -n '4p' "$MAKE_CALLS")

grep -Fq 'BUILD_EXCLUSIVE_KERNEL_MIN="6.16"' "$DKMS_CONFIG_UNDER_TEST" ||
fail "DKMS configuration omitted the supported kernel floor"
# Match the literal variables that DKMS expands during a module build.
# shellcheck disable=SC2016
grep -Fq 'build-module ${kernelver} ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build' \
"$DKMS_CONFIG_UNDER_TEST" || fail "DKMS build command omitted the explicit module source path"

Expand Down
26 changes: 15 additions & 11 deletions tests/linux/test-vibeshine-drm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ printf '/* test source */\n' >"$TEST_SOURCE/vkms_drv.c"
printf 'all:\n' >"$TEST_MODULES/$TEST_KERNEL/build/Makefile"
cp -- "$TEST_SCRIPT_DIR/../../linux/vibeshine-drm/build-module" "$TEST_SOURCE/build-module"
chmod 0755 "$TEST_SOURCE/build-module"
printf '#!/usr/bin/env bash\nprintf "signed:%%s\\n" "$1" >>"$4"\n' >"$TEST_MODULES/$TEST_KERNEL/build/scripts/sign-file"
cat >"$TEST_MODULES/$TEST_KERNEL/build/scripts/sign-file" <<'EOF'
#!/usr/bin/env bash
printf "signed:%s\n" "$1" >>"$4"
EOF
chmod 0755 "$TEST_MODULES/$TEST_KERNEL/build/scripts/sign-file"

configure_install_paths \
Expand Down Expand Up @@ -440,7 +443,6 @@ test_dkms_signing_mismatch_falls_back() (

test_signing_status() (
MOK_ENROLLED=0
EFI_MOK_VARIABLES_ROOT="$TEST_ROOT/signing-status-mok-variables"
SIGNING_STATUS_LOG="$TEST_ROOT/signing-status.log"
mkdir -p -- "$EFI_MOK_VARIABLES_ROOT"

Expand Down Expand Up @@ -499,18 +501,20 @@ test_secure_boot_and_enforcement_detection() (
fail "unenforced module signatures were reported as enforced"
fi

EFI_MOK_VARIABLES_ROOT="$TEST_ROOT/trust-mok-variables"
mkdir -p -- "$EFI_MOK_VARIABLES_ROOT"
printf '\x00' >"$EFI_MOK_VARIABLES_ROOT/MokListTrustedRT"
if mok_list_is_trusted; then
local trust_mok_variables="$TEST_ROOT/trust-mok-variables"
mkdir -p -- "$trust_mok_variables"
printf '\x00' >"$trust_mok_variables/MokListTrustedRT"
if EFI_MOK_VARIABLES_ROOT="$trust_mok_variables" mok_list_is_trusted; then
fail "a disabled MokListTrustedRT flag was accepted"
fi
printf '\x01' >"$EFI_MOK_VARIABLES_ROOT/MokListTrustedRT"
mok_list_is_trusted || fail "the shim MOK trust flag was not detected"
printf '\x01' >"$trust_mok_variables/MokListTrustedRT"
EFI_MOK_VARIABLES_ROOT="$trust_mok_variables" mok_list_is_trusted ||
fail "the shim MOK trust flag was not detected"

rm -f -- "$EFI_MOK_VARIABLES_ROOT/MokListTrustedRT"
rm -f -- "$trust_mok_variables/MokListTrustedRT"
printf '\x07\x00\x00\x00\x01' >"$EFI_VARS_ROOT/MokListTrustedRT-test"
mok_list_is_trusted || fail "the EFI-variable MOK trust flag was not detected"
EFI_MOK_VARIABLES_ROOT="$trust_mok_variables" mok_list_is_trusted ||
fail "the EFI-variable MOK trust flag was not detected"
)

test_partial_signing_key_is_preserved() (
Expand Down Expand Up @@ -680,7 +684,7 @@ configure_install_paths \
mkdir -p -- "$SYS_MODULE_ROOT"
test_dkms_failure_falls_back
test_dkms_signing_mismatch_falls_back
test_signing_status
EFI_MOK_VARIABLES_ROOT="$TEST_ROOT/signing-status-mok-variables" test_signing_status
test_secure_boot_and_enforcement_detection
test_partial_signing_key_is_preserved
test_existing_signing_pair_rejects_symlinked_directory
Expand Down
4 changes: 4 additions & 0 deletions tests/linux/test-vibeshine-vkms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ configure_lease_paths "$TEST_ROOT/vkms-leases"
FAKE_CONFIGFS=1

[[ $VKMS_OUTPUT_COUNT -eq 8 ]] || fail "new pools must support eight client identities"
# The sourced pool helper calls this override.
# shellcheck disable=SC2329
configfs_is_mounted() { return 0; }
OWNER_UID=11001
OTHER_UID=11002
Expand Down Expand Up @@ -357,6 +359,8 @@ mv -- "$TEST_ROOT/Virtual-1.saved" "$VKMS_DEVICE_DIR/connectors/Virtual-1"
# normal full cleanup behavior used by hot reload and package removal.
response=$(printf 'connect Virtual-4\n' | control_connection "$OWNER_UID") || fail "pool cleanup lease setup failed"
assert_file_value "$LEASE_ROOT/Virtual-4.owner" "$OWNER_UID"
# The sourced stop_pool function calls this override.
# shellcheck disable=SC2329
system_is_stopping() {
return 0
}
Expand Down
Loading