Skip to content

Commit 8ef6ae4

Browse files
committed
libjob/test: add informational test for string_unwrap()
Problem: When there is a local problem configuring flux-security, diagnosis from the unwrap unit tests is difficult because errors are suppressed in the tests. Add a test that captures any error from sign_unwrap() for help debugging future issues.
1 parent 0f8ecc1 commit 8ef6ae4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/common/libjob/test/unwrap.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ static void test_api (unwrap_f unwrap)
4747
"error.text says: %s",
4848
error.text);
4949

50+
userid = 0;
51+
result = (*unwrap) (s, false, NULL, &error);
52+
ok (result != NULL && userid == 0,
53+
"unwrap_string() works with NULL userid");
54+
if (result == NULL)
55+
diag ("got error: %s", error.text);
56+
is (result, "bar",
57+
"got expected result");
58+
free (result);
59+
5060
userid = 0;
5161
result = (*unwrap) (s, false, NULL, NULL);
5262
ok (result != NULL && userid == 0,

0 commit comments

Comments
 (0)