Skip to content

Commit

Permalink
Move test-suite dbpath setup to macros.testenv too
Browse files Browse the repository at this point in the history
Somehow missed this opportunity in add3e06.
With this and 78c21f4, we really now
have a central place to configure system-wide macros in a prefix
independent manner.
  • Loading branch information
pmatilai committed Jan 30, 2025
1 parent 7657608 commit 970f691
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions tests/data/macros.testenv
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
%_buildhost testhost
%_topdir %{getenv:RPMTEST}/build
%_tmppath %{getenv:RPMTEST}/var/tmp
%_dbpath /var/lib/rpm-testsuite
9 changes: 3 additions & 6 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ export DESTDIR=${1:-/}
mkdir -p $DESTDIR/build
ln -sf ../data/SOURCES $DESTDIR/build/

# setup an empty db that all tests are pointed to by default
dbpath="/var/lib/rpm-testsuite"
mkdir -p $DESTDIR/$dbpath
echo "%_dbpath $dbpath" > $DESTDIR/@CMAKE_INSTALL_FULL_SYSCONFDIR@/rpm/macros.db
rpmdb --dbpath $DESTDIR/$dbpath --initdb

# system-wide config to match our test environment
cp /data/macros.testenv $DESTDIR/@CMAKE_INSTALL_FULL_SYSCONFDIR@/rpm/

# setup an empty db that all tests are pointed to by default
rpmdb --dbpath $DESTDIR/$(rpm --eval "%{_dbpath}") --initdb

# gpg-connect-agent is very, very unhappy if this doesn't exist
mkdir -p $DESTDIR/root/.gnupg
chmod 700 $DESTDIR/root/.gnupg
Expand Down

0 comments on commit 970f691

Please # to comment.