summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2023-05-19 12:16:52 +0200
committerLuflosi <luflosi@luflosi.de>2023-05-19 14:35:06 +0200
commit2e3134c536b6d2782415c2982a1860dd77302f9a (patch)
treef0735bb0eef3ecd3c8e9fda74e49caaf832592da /nixos/tests
parent58e7a9dc4263cf45711e9c804ca80523d277e2e6 (diff)
apfsprogs: build apfs-snap
Build the apfs-snap tool, which was added some time ago.
Also add a NixOS test for it.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/apfs.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/tests/apfs.nix b/nixos/tests/apfs.nix
index ac0459b57e9ce..9fe689951c783 100644
--- a/nixos/tests/apfs.nix
+++ b/nixos/tests/apfs.nix
@@ -48,5 +48,18 @@ import ./make-test-python.nix ({ pkgs, ... }: {
           "umount /tmp/mnt",
           "apfsck /dev/vdb",
       )
+    with subtest("Snapshots"):
+      machine.succeed(
+          "mkapfs /dev/vdb",
+          "mount -o cknodes,readwrite /dev/vdb /tmp/mnt",
+          "echo 'Hello World' > /tmp/mnt/test.txt",
+          "apfs-snap /tmp/mnt snap-1",
+          "rm /tmp/mnt/test.txt",
+          "umount /tmp/mnt",
+          "mount -o cknodes,readwrite,snap=snap-1 /dev/vdb /tmp/mnt",
+          "echo 'Hello World' | diff - /tmp/mnt/test.txt",
+          "umount /tmp/mnt",
+          "apfsck /dev/vdb",
+      )
   '';
 })