Skip to content

Set TMPDIR to a location juju can access#403

Merged
dosaboy merged 1 commit into
canonical:mainfrom
dosaboy:charm-functest-tmpdir
Jun 16, 2026
Merged

Set TMPDIR to a location juju can access#403
dosaboy merged 1 commit into
canonical:mainfrom
dosaboy:charm-functest-tmpdir

Conversation

@dosaboy

@dosaboy dosaboy commented Jun 16, 2026

Copy link
Copy Markdown
Member

No description provided.

export TEST_ZAZA_BUG_LP1987332=1

# Juju 3.x is a confined snap so cannot read/write from/to /tmp. This makes the tests use a path that juju can read/write.
export TMPDIR=$HOME/tmp

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.

You could also

Suggested change
export TMPDIR=$HOME/tmp
export TMPDIR=$(mktemp ${HOME}/bundles-XXXXXX)


# Juju 3.x is a confined snap so cannot read/write from/to /tmp. This makes the tests use a path that juju can read/write.
export TMPDIR=$HOME/tmp
mkdir -p $TMPDIR

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.

And then get rid of this line.

@dosaboy dosaboy force-pushed the charm-functest-tmpdir branch from 54bb95c to 2788427 Compare June 16, 2026 16:43

if [ -d $TMPDIR ]; then
rm -rf $TMPDIR
unset TMPDIR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it is if we dont want to have a new directory every time we run the script

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was referring the unset TMPDIR line. At script exit, this doesn't make any difference.

@pponnuvel pponnuvel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@dosaboy dosaboy added this pull request to the merge queue Jun 16, 2026
Merged via the queue into canonical:main with commit 906ebef Jun 16, 2026
4 of 5 checks passed
@dosaboy dosaboy deleted the charm-functest-tmpdir branch June 16, 2026 17:13
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.

3 participants