summaryrefslogtreecommitdiff
path: root/trust/tests
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-23 23:04:32 +0200
committerStef Walter <stef@thewalter.net>2013-07-24 10:12:44 +0200
commit2e7952e62ef205c67175e3e717526e4375ca8325 (patch)
tree4c2cd1e11f12979bf0ca4f4019f22ea1e81ebae0 /trust/tests
parent02a3bbd560bdb56501fea1b46c5583582832b008 (diff)
Make tests work on file systems with block size directories
On certain file systems the size of the directory does not change when adding a file. This caused the tests to fail. Make the tests wait more than a second in certain tests to get the mtime to change. https://bugs.freedesktop.org/show_bug.cgi?id=65249
Diffstat (limited to 'trust/tests')
-rw-r--r--trust/tests/test-token.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/trust/tests/test-token.c b/trust/tests/test-token.c
index 3b7d701..bdf1120 100644
--- a/trust/tests/test-token.c
+++ b/trust/tests/test-token.c
@@ -305,6 +305,9 @@ test_load_already (void)
handle = p11_index_find (test.index, cert, -1);
assert (handle != 0);
+ /* Have to wait to make sure changes are detected */
+ p11_sleep_ms (1100);
+
ret = p11_token_load (test.token);
assert_num_eq (ret, 0);
assert_num_eq (p11_index_find (test.index, cert, -1), handle);
@@ -331,6 +334,9 @@ test_load_unreadable (void)
test_write_file (test.directory, "test.cer", "", 0);
+ /* Have to wait to make sure changes are detected */
+ p11_sleep_ms (1100);
+
ret = p11_token_load (test.token);
assert_num_eq (ret, 0);
assert (p11_index_find (test.index, cert, -1) == 0);
@@ -357,6 +363,9 @@ test_load_gone (void)
test_delete_file (test.directory, "test.cer");
+ /* Have to wait to make sure changes are detected */
+ p11_sleep_ms (1100);
+
ret = p11_token_load (test.token);
assert_num_eq (ret, 0);
assert (p11_index_find (test.index, cert, -1) == 0);
@@ -378,6 +387,9 @@ test_load_found (void)
assert_num_eq (ret, 0);
assert (p11_index_find (test.index, cert, -1) == 0);
+ /* Have to wait to make sure changes are detected */
+ p11_sleep_ms (1100);
+
test_write_file (test.directory, "test.cer", test_cacert3_ca_der,
sizeof (test_cacert3_ca_der));