Skip to content

Commit 535c286

Browse files
committed
tests: Extend a test script with signing and verifying a symlink'ed file
Signed-off-by: Stefan Berger <[email protected]>
1 parent 6c55dcf commit 535c286

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/tests/test-sign-verify

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ echo "Testing 'sign/verify' certificate when in subdir of model directory and us
164164

165165
rm -f "$(basename "${sigfile}")"
166166
mkdir subdir
167+
168+
# Create a symlink'ed file
169+
echo "foo" > subdir/symlinked
170+
ln -s subdir/symlinked symlink
171+
167172
pushd subdir 1>/dev/null || exit 1
168173

169174
if ! python -m model_signing \
@@ -173,6 +178,7 @@ if ! python -m model_signing \
173178
--signing_certificate "${DIR}/keys/certificate/signing-key-cert.pem" \
174179
--certificate_chain "${DIR}/keys/certificate/int-ca-cert.pem" \
175180
--ignore-paths "../$(basename "${ignorefile}")" \
181+
--allow_symlinks \
176182
.. ; then
177183
echo "Error: 'sign key' failed"
178184
exit 1
@@ -185,14 +191,15 @@ if ! python -m model_signing \
185191
--signature "$(basename "${sigfile}")" \
186192
--certificate_chain "${DIR}/keys/certificate/ca-cert.pem" \
187193
--ignore-paths "$(basename "${ignorefile}")" \
194+
--allow_symlinks \
188195
. ; then
189196
echo "Error: 'sign key' failed"
190197
exit 1
191198
fi
192199

193200
# Check which files are part of signature
194201
res=$(get_signed_files "${sigfile}")
195-
exp='["signme-1","signme-2"]'
202+
exp='["signme-1","signme-2","subdir/symlinked","symlink"]'
196203
if [ "${res}" != "${exp}" ]; then
197204
echo "Error: Unexpected files were signed"
198205
echo "Expected: ${exp}"

0 commit comments

Comments
 (0)