Skip to content

"file not found" on temporary files with host /tmp usage  #83

@d-e-s-o

Description

@d-e-s-o

After 0a63dce I am seeing test failures when working with temporary files (everything works if I back the commit out). For example:

  use tempfile::tempfile;

  #[test]
  fn foobar() {
    let file = tempfile().unwrap();
    let _meta = file.metadata().unwrap();
  }

when run in with something like:

vmtest -k /tmp/bzImage-v6.6-empty -- foobar-9a2323dd7af7c821

fails with:

thread 'tests::foobar' panicked at src/main.rs:15:33:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried that or similar things on three different systems, leading me to believe this isn't exactly specific to my setup. I suspect this is some sort of limitation of 9P fs, but don't know much about it. The error disappears when using a named temporary file.

Any ideas? Temporary files seem pretty important for testing. I can work around it by setting TMPDIR=/var/run/ inside the VM, but it's not great. And there are still other issues of similar but potentially slightly different nature that this does not resolve. So perhaps we should go back to using a dedicated tmpfs after all? :-(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions