Skip to content

test: remove hardcoded /tmp#296

Merged
cgwalters merged 1 commit intocomposefs:mainfrom
Kiskae:upstream-tmpdir-fix
Jun 4, 2024
Merged

test: remove hardcoded /tmp#296
cgwalters merged 1 commit intocomposefs:mainfrom
Kiskae:upstream-tmpdir-fix

Conversation

@Kiskae
Copy link
Copy Markdown
Contributor

@Kiskae Kiskae commented Jun 4, 2024

Just upstreaming some things I ran into while I was originally packaging for nixpkgs.
Since the builds happen in a minimal sandbox it was running into non-existing directories.

The only thing I'm not sure about is the tests that involve fsverity since usually /tmp is a tmpfs and might not support it. But in that case it is probably a better idea to specifically set $TMPDIR for those tests rather than hardcoding /var/tmp

Signed-off-by: Kiskae <Kiskae@users.noreply.github.com>
check_fsverity () {
fsverity --version >/dev/null 2>&1 || return 1
tmpfile=$(mktemp /var/tmp/lcfs-fsverity.XXXXXX)
tmpfile=$(mktemp --tmpdir lcfs-fsverity.XXXXXX)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically this, its probably a better idea to override $TMPDIR before test-lib.sh is loaded to get fsverify support.

Maybe something like:

if [[ -z "${COMPOSEFS_FSVERITY_USE_TMPDIR:-}" ]]; then
    TMPDIR="/var/tmp"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, our default CI here using Ubuntu has use_fsverity=n which we need to fix anyways independently of this, and agree that setting TMPDIR externally to the tests is right.

@cgwalters cgwalters merged commit 3d2af03 into composefs:main Jun 4, 2024
@Kiskae Kiskae deleted the upstream-tmpdir-fix branch June 4, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants