tests: Enable mtime test
authorColin Walters <walters@verbum.org>
Thu, 29 Jun 2023 06:11:09 +0000 (02:11 -0400)
committerColin Walters <walters@verbum.org>
Thu, 29 Jun 2023 06:11:09 +0000 (02:11 -0400)
I think this just accidentally was never enabled.

While looking at the code, add a sleep here to be resilient to
filesystems with only second mtime granularity.

tests/inst/src/insttestmain.rs
tests/inst/src/repobin.rs

index 92ca8e014c5c1ed1149cd9fac2ab88c2ebf3b9f3..599dbef6010232d3481f805745636443d3ee03ba 100644 (file)
@@ -26,6 +26,7 @@ const TESTS: &[StaticTest] = &[
     test!(sysroot::itest_tmpfiles),
     test!(repobin::itest_basic),
     test!(repobin::itest_nofifo),
+    test!(repobin::itest_mtime),
     test!(repobin::itest_extensions),
     test!(repobin::itest_pull_basicauth),
 ];
index 4048b76a4291a50c23f861248690f2a4b965a6c6..af2096f2e4539aa7d9da2a7218f20473abef93bd 100644 (file)
@@ -42,6 +42,7 @@ pub(crate) fn itest_mtime() -> Result<()> {
 "
     )?;
     let ts = Path::new("repo").metadata()?.modified().unwrap();
+    std::thread::sleep(std::time::Duration::from_secs(1));
     bash!(r#"ostree --repo=repo commit -b test -s "bump mtime" --tree=dir=tmproot >/dev/null"#)?;
     assert_ne!(ts, Path::new("repo").metadata()?.modified().unwrap());
     Ok(())