Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Test without a cache directory by default #2352

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libostree/ostree-repo.c
Original file line number Diff line number Diff line change
Expand Up @@ -3291,7 +3291,7 @@ ostree_repo_open (OstreeRepo *self,
if (!glnx_opendirat (self->repo_dir_fd, "tmp", TRUE, &self->tmp_dir_fd, error))
return FALSE;

if (self->writable)
if (self->writable && getenv ("OSTREE_SKIP_CACHE") == NULL)
{
if (!glnx_shutil_mkdir_p_at (self->tmp_dir_fd, _OSTREE_CACHE_DIR, DEFAULT_DIRECTORY_MODE, cancellable, error))
return FALSE;
Expand Down
5 changes: 5 additions & 0 deletions tests/libtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ unset TAR_OPTIONS
# easily clean up.
export OSTREE_SYSROOT_DEBUG=mutable-deployments

# By default, don't use a cache directory since it makes the tests racy.
# Tests that are explicitly testing the cache operation should unset
# this.
export OSTREE_SKIP_CACHE=1

export TEST_GPG_KEYID_1="7FCA23D8472CDAFA"
export TEST_GPG_KEYFPR_1="5E65DE75AB1C501862D476347FCA23D8472CDAFA"
export TEST_GPG_KEYID_2="D8228CFECA950D41"
Expand Down
3 changes: 3 additions & 0 deletions tests/test-pull-summary-caching.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ if ! has_gpgme; then
exit 0
fi

# Ensure repo caching is in use.
unset OSTREE_SKIP_CACHE

COMMIT_SIGN="--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1}"

echo "1..1"
Expand Down
3 changes: 3 additions & 0 deletions tests/test-pull-summary-sigs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ set -euo pipefail

. $(dirname $0)/libtest.sh

# Ensure repo caching is in use.
unset OSTREE_SKIP_CACHE

COMMIT_SIGN=""
if has_gpgme; then
COMMIT_SIGN="--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1}"
Expand Down
3 changes: 3 additions & 0 deletions tests/test-signed-pull-summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ set -euo pipefail

echo "1..14"

# Ensure repo caching is in use.
unset OSTREE_SKIP_CACHE

# This is explicitly opt in for testing
export OSTREE_DUMMY_SIGN_ENABLED=1

Expand Down