From 2e7952e62ef205c67175e3e717526e4375ca8325 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 23 Jul 2013 23:04:32 +0200 Subject: 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 --- trust/tests/test-token.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'trust') 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)); -- cgit v1.1