Skip to content

Commit

Permalink
tests: Don't assume /dev/loop0 exists (#328)
Browse files Browse the repository at this point in the history
It doesn't by default on e.g. current Fedora and RHEL systems.
I suspect most people so far have been running this on Ubuntu which
uses snaps which use loopback devices, but we can't rely on that.

For test coverage here, ultimately there's not really a good block
device to rely on without going through a lot of special casing.

Let's just test character devices.
  • Loading branch information
cgwalters authored Jun 4, 2024
1 parent ac38b1e commit a37c9b6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,10 +1386,7 @@ fn tar_directory_containing_special_files() {
// append_path has a different logic for processing files, so we need to test it as well
t!(ar.append_path("fifo"));
t!(ar.append_dir_all("special", td.path()));
// unfortunately, block device file cannot be created by non-root users
// as a substitute, just test the file that exists on most Unix systems
t!(env::set_current_dir("/dev/"));
t!(ar.append_path("loop0"));
// CI systems seem to have issues with creating a chr device
t!(ar.append_path("null"));
t!(ar.finish());
Expand Down

0 comments on commit a37c9b6

Please sign in to comment.