Skip to content

Commit

Permalink
Add test for generate-keypair
Browse files Browse the repository at this point in the history
Signed-off-by: Zoltan Fridrich <[email protected]>
  • Loading branch information
ZoltanFridrich committed Sep 14, 2023
1 parent a183d2e commit 04fc3e5
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions p11-kit/test-objects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable list-objects -q "pkcs11:" > list.out

echo 1..6
echo 1..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
Expand Down Expand Up @@ -118,7 +118,7 @@ EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable list-objects -q "pkcs11:type=data" > list.out

echo 2..6
echo 2..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
Expand All @@ -139,7 +139,7 @@ EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable list-objects -q "pkcs11:model=TEST%20MODEL;manufacturer=TEST%20MANUFACTURER;serial=TEST%20SERIAL;token=TEST%20LABEL;object=TEST%20CERTIFICATE;type=cert" > list.out

echo 3..6
echo 3..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
Expand All @@ -155,7 +155,7 @@ EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable list-objects -q "pkcs11:model=NONEXISTENT" > list.out

echo 4..6
echo 4..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
Expand All @@ -181,7 +181,7 @@ EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable export-object -q "pkcs11:model=TEST%20MODEL;manufacturer=TEST%20MANUFACTURER;serial=TEST%20SERIAL;token=TEST%20LABEL;object=TEST%20CERTIFICATE;type=cert" > list.out

echo 5..6
echo 5..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
Expand All @@ -202,7 +202,7 @@ EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable export-object -q "pkcs11:model=TEST%20MODEL;manufacturer=TEST%20MANUFACTURER;serial=TEST%20SERIAL;token=TEST%20LABEL;object=TEST%20PUBLIC%20KEY;type=public" > list.out

echo 6..6
echo 6..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
Expand All @@ -212,3 +212,19 @@ else
sed 's/^/# /' list.diff
exit 1
fi

cat > list.exp <<EOF
EOF

"$abs_top_builddir"/p11-kit/p11-kit-testable generate-keypair -q --type=mock "pkcs11:" > list.out

echo 7..7

: ${DIFF=diff}
if ${DIFF} list.exp list.out > list.diff; then
echo "ok 7 /objects/generate-keypair"
else
echo "not ok 7 /objects/generate-keypair"
sed 's/^/# /' list.diff
exit 1
fi

0 comments on commit 04fc3e5

Please sign in to comment.