forked from rpm-software-management/rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run test-suite environment setup inside the image
Commit c17cc69 introduced an `rpmdb --initdb` call into test-suite make_install() but at that point, it's actually the rpm from the host, which is NOT what we want. Split the image preparation to two stages: install, which runs from the outside and basically just copies data into the image, and setup which runs from inside the image. For this we need some extra container gymnastics. Fixes: rpm-software-management#3530
- Loading branch information
Showing
5 changed files
with
35 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ case $CMD in | |
build) | ||
source ./mktree.common | ||
make_install / | ||
./setup.sh / | ||
;; | ||
check) | ||
./rpmtests "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -x | ||
|
||
# Setup the environment inside the test-image | ||
# DESTDIR is only for testing purposes, inside the image it's always / | ||
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/ | ||
|
||
# gpg-connect-agent is very, very unhappy if this doesn't exist | ||
mkdir -p $DESTDIR/root/.gnupg | ||
chmod 700 $DESTDIR/root/.gnupg | ||
|
||
# set up new-style XDG config directory | ||
mkdir -p $DESTDIR/root/.config/rpm | ||
|