]> granicus.if.org Git - p11-kit/commitdiff
Make tests work on file systems with block size directories
authorStef Walter <stef@thewalter.net>
Tue, 23 Jul 2013 21:04:32 +0000 (23:04 +0200)
committerStef Walter <stef@thewalter.net>
Wed, 24 Jul 2013 08:12:44 +0000 (10:12 +0200)
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

index 3b7d701177c1927147d088758f634209a76c8103..bdf1120b3195e51b8af80ed7d082e6685f69be87 100644 (file)
@@ -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));