Skip to content

Commit 0ee4907

Browse files
committed
Extend backup_remote() test case
Extend the backup_remote() test case by making sure that a file is present in the subvolume and contains the expected content after backup.
1 parent 2e67cd2 commit 0ee4907

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

tests/end-to-end.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2023-2025 Daniel Mueller <deso@posteo.net>
1+
// Copyright (C) 2023-2026 Daniel Mueller <deso@posteo.net>
22
// SPDX-License-Identifier: GPL-3.0-or-later
33

44
#![allow(clippy::unwrap_used)]
@@ -492,6 +492,8 @@ fn backup_remote() {
492492

493493
let subvol = src_root.join("subvol");
494494
let () = btrfs.create_subvol(&subvol).unwrap();
495+
let file = subvol.join("file");
496+
let () = write(&file, "test12345").unwrap();
495497

496498
let remote_cmd = format!("chroot {} /bin/sh-run", dst_root.display());
497499
let args = [
@@ -504,6 +506,17 @@ fn backup_remote() {
504506
OsStr::new(&remote_cmd),
505507
];
506508
let () = run(args).unwrap();
509+
510+
let dst_subvol = dst_root.join("backups");
511+
let snapshot = dst_subvol
512+
.read_dir()
513+
.unwrap()
514+
.next()
515+
.unwrap()
516+
.unwrap()
517+
.path();
518+
let content = read_to_string(snapshot.join("file")).unwrap();
519+
assert_eq!(content, "test12345");
507520
})
508521
})
509522
}

0 commit comments

Comments
 (0)