Initial test for baseruntime module
This commit is contained in:
parent
8f5ef86e5f
commit
a614dfd535
15 changed files with 1203 additions and 0 deletions
34
tests/resources/base-runtime-mock.cfg
Normal file
34
tests/resources/base-runtime-mock.cfg
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
config_opts['root'] = 'base-runtime-docker'
|
||||
config_opts['target_arch'] = 'x86_64'
|
||||
config_opts['legal_host_arches'] = ('x86_64',)
|
||||
config_opts['chroot_setup_cmd'] = 'install --setopt=tsflags=nodocs bash coreutils-single filesystem glibc-minimal-langpack libcrypt microdnf rpm shadow-utils util-linux'
|
||||
config_opts['dist'] = ''
|
||||
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
|
||||
config_opts['releasever'] = ''
|
||||
config_opts['package_manager'] = 'dnf'
|
||||
|
||||
config_opts['yum.conf'] = """
|
||||
[main]
|
||||
keepcache=1
|
||||
debuglevel=2
|
||||
reposdir=/dev/null
|
||||
logfile=/var/log/yum.log
|
||||
retries=20
|
||||
obsoletes=1
|
||||
gpgcheck=0
|
||||
assumeyes=1
|
||||
syslog_ident=mock
|
||||
syslog_device=
|
||||
install_weak_deps=0
|
||||
metadata_expire=3600
|
||||
mdpolicy=group:primary
|
||||
|
||||
# repos
|
||||
|
||||
[buildrepo]
|
||||
name=base-runtime
|
||||
baseurl=https://kojipkgs.stg.fedoraproject.org/compose/branched/jkaluza/latest-Boltron-26/compose/base-runtime/x86_64/os/
|
||||
enabled=1
|
||||
|
||||
"""
|
||||
4
tests/resources/hello-world/Makefile
Normal file
4
tests/resources/hello-world/Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
default: hello
|
||||
|
||||
hello: hello.c
|
||||
gcc -Wall hello.c -o hello
|
||||
15
tests/resources/hello-world/README.md
Normal file
15
tests/resources/hello-world/README.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# compiler sanity smoke test for the Base Runtime docker image
|
||||
|
||||
The internal workings of this test are as follows:
|
||||
|
||||
1. Create a temporary directory.
|
||||
2. Copy the `hello.sh` script from this resource directory into the temporary directory and make sure it is executable.
|
||||
3. Place a gzipped tarball of `hello.c` and `Makefile` from this resource directory into the temporary directory with the name `hello.tgz`.
|
||||
e.g.,
|
||||
`$ tar czf /tmp/random/hello.tgz hello.c Makefile`
|
||||
4. Run the docker container binding the temporary directory as `/mnt` and run `/mnt/hello.sh`.
|
||||
e.g.,
|
||||
`$ docker run -v /tmp/random:/mnt:z --rm base-runtime /bin/bash -c /mnt/hello.sh`
|
||||
5. Clean up the temporary directory upon completion.
|
||||
|
||||
|
||||
8
tests/resources/hello-world/hello.c
Normal file
8
tests/resources/hello-world/hello.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
printf ("Hello, world!\n");
|
||||
return 0;
|
||||
}
|
||||
7
tests/resources/hello-world/hello.sh
Executable file
7
tests/resources/hello-world/hello.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -e # exit immediately on any failure
|
||||
microdnf install tar make gcc 1>&2
|
||||
cd /mnt
|
||||
tar xzvf hello.tgz 1>&2
|
||||
make 1>&2
|
||||
./hello
|
||||
111
tests/resources/installed_packages/all_installed_pkgs_docker.txt
Normal file
111
tests/resources/installed_packages/all_installed_pkgs_docker.txt
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
audit-libs
|
||||
basesystem
|
||||
bash
|
||||
bzip2-libs
|
||||
ca-certificates
|
||||
chkconfig
|
||||
coreutils-single
|
||||
cracklib
|
||||
crypto-policies
|
||||
curl
|
||||
cyrus-sasl-lib
|
||||
elfutils-libelf
|
||||
expat
|
||||
fedora-modular-release
|
||||
filesystem
|
||||
gawk
|
||||
glib2
|
||||
glibc
|
||||
glibc-common
|
||||
glibc-minimal-langpack
|
||||
gmp
|
||||
gnupg2
|
||||
gnutls
|
||||
gobject-introspection
|
||||
gpgme
|
||||
grep
|
||||
gzip
|
||||
info
|
||||
keyutils-libs
|
||||
krb5-libs
|
||||
libacl
|
||||
libarchive
|
||||
libassuan
|
||||
libattr
|
||||
libblkid
|
||||
libcap
|
||||
libcap-ng
|
||||
libcom_err
|
||||
libcrypt
|
||||
libcurl
|
||||
libdb
|
||||
libdb-utils
|
||||
libdnf
|
||||
libfdisk
|
||||
libffi
|
||||
libgcc
|
||||
libgcrypt
|
||||
libgpg-error
|
||||
libidn2
|
||||
libksba
|
||||
libmetalink
|
||||
libmount
|
||||
libnghttp2
|
||||
libpeas
|
||||
libpsl
|
||||
libpwquality
|
||||
librepo
|
||||
libselinux
|
||||
libsemanage
|
||||
libsepol
|
||||
libsigsegv
|
||||
libsmartcols
|
||||
libsolv
|
||||
libssh2
|
||||
libtasn1
|
||||
libunistring
|
||||
libutempter
|
||||
libuuid
|
||||
libverto
|
||||
libxml2
|
||||
lua-libs
|
||||
lz4
|
||||
lz4-libs
|
||||
lzo
|
||||
microdnf
|
||||
mpfr
|
||||
ncurses
|
||||
ncurses-base
|
||||
ncurses-libs
|
||||
nettle
|
||||
npth
|
||||
nspr
|
||||
nss
|
||||
nss-pem
|
||||
nss-softokn
|
||||
nss-softokn-freebl
|
||||
nss-sysinit
|
||||
nss-tools
|
||||
nss-util
|
||||
openldap
|
||||
openssl-libs
|
||||
p11-kit
|
||||
p11-kit-trust
|
||||
pam
|
||||
pcre
|
||||
popt
|
||||
publicsuffix-list-dafsa
|
||||
readline
|
||||
rpm
|
||||
rpm-libs
|
||||
rpm-plugin-selinux
|
||||
sed
|
||||
setup
|
||||
shadow-utils
|
||||
sqlite-libs
|
||||
systemd-libs
|
||||
tzdata
|
||||
ustr
|
||||
util-linux
|
||||
xz-libs
|
||||
zlib
|
||||
144
tests/resources/installed_packages/all_installed_pkgs_nspawn.txt
Normal file
144
tests/resources/installed_packages/all_installed_pkgs_nspawn.txt
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
acl
|
||||
audit-libs
|
||||
basesystem
|
||||
bash
|
||||
binutils
|
||||
bzip2-libs
|
||||
ca-certificates
|
||||
chkconfig
|
||||
coreutils-single
|
||||
cpp
|
||||
cracklib
|
||||
cracklib-dicts
|
||||
crypto-policies
|
||||
cryptsetup-libs
|
||||
curl
|
||||
cyrus-sasl-lib
|
||||
dbus
|
||||
dbus-libs
|
||||
device-mapper
|
||||
device-mapper-libs
|
||||
diffutils
|
||||
elfutils-default-yama-scope
|
||||
elfutils-libelf
|
||||
elfutils-libs
|
||||
emacs-filesystem
|
||||
expat
|
||||
fedora-modular-release
|
||||
filesystem
|
||||
gawk
|
||||
gc
|
||||
gcc
|
||||
glib2
|
||||
glibc
|
||||
glibc-common
|
||||
glibc-devel
|
||||
glibc-headers
|
||||
glibc-minimal-langpack
|
||||
gmp
|
||||
gnupg2
|
||||
gnutls
|
||||
gobject-introspection
|
||||
gpgme
|
||||
grep
|
||||
guile
|
||||
gzip
|
||||
info
|
||||
iptables-libs
|
||||
isl
|
||||
kernel-headers
|
||||
keyutils-libs
|
||||
kmod-libs
|
||||
krb5-libs
|
||||
libacl
|
||||
libarchive
|
||||
libassuan
|
||||
libatomic_ops
|
||||
libattr
|
||||
libblkid
|
||||
libcap
|
||||
libcap-ng
|
||||
libcom_err
|
||||
libcrypt
|
||||
libcurl
|
||||
libdb
|
||||
libdb-utils
|
||||
libdnf
|
||||
libfdisk
|
||||
libffi
|
||||
libgcc
|
||||
libgcrypt
|
||||
libgomp
|
||||
libgpg-error
|
||||
libidn
|
||||
libidn2
|
||||
libksba
|
||||
libmetalink
|
||||
libmount
|
||||
libmpc
|
||||
libnghttp2
|
||||
libpcap
|
||||
libpeas
|
||||
libpsl
|
||||
libpwquality
|
||||
librepo
|
||||
libseccomp
|
||||
libselinux
|
||||
libsemanage
|
||||
libsepol
|
||||
libsigsegv
|
||||
libsmartcols
|
||||
libsolv
|
||||
libssh2
|
||||
libstdc++
|
||||
libtasn1
|
||||
libtool-ltdl
|
||||
libunistring
|
||||
libutempter
|
||||
libuuid
|
||||
libverto
|
||||
libxml2
|
||||
lua-libs
|
||||
lz4-libs
|
||||
lzo
|
||||
make
|
||||
microdnf
|
||||
mpfr
|
||||
ncurses-base
|
||||
ncurses-libs
|
||||
nettle
|
||||
npth
|
||||
nspr
|
||||
nss
|
||||
nss-pem
|
||||
nss-softokn
|
||||
nss-softokn-freebl
|
||||
nss-sysinit
|
||||
nss-tools
|
||||
nss-util
|
||||
openldap
|
||||
openssl-libs
|
||||
p11-kit
|
||||
p11-kit-trust
|
||||
pam
|
||||
pcre
|
||||
popt
|
||||
publicsuffix-list-dafsa
|
||||
qrencode-libs
|
||||
readline
|
||||
rpm
|
||||
rpm-libs
|
||||
rpm-plugin-selinux
|
||||
sed
|
||||
setup
|
||||
shadow-utils
|
||||
sqlite-libs
|
||||
systemd
|
||||
systemd-libs
|
||||
systemd-pam
|
||||
tar
|
||||
tzdata
|
||||
ustr
|
||||
util-linux
|
||||
xz-libs
|
||||
zlib
|
||||
96
tests/resources/os_release/os_release.sh
Executable file
96
tests/resources/os_release/os_release.sh
Executable file
|
|
@ -0,0 +1,96 @@
|
|||
#!/bin/bash
|
||||
set -e # exit immediately on any failure
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
EXP_NAME="Fedora Modular"
|
||||
EXP_VERSION="26 (Twenty Six)"
|
||||
EXP_ID="fedora-modular"
|
||||
EXP_ID_LIKE="fedora"
|
||||
EXP_VERSION_ID="26"
|
||||
EXP_PRETTY_NAME="Fedora Modular 26 (Twenty Six)"
|
||||
EXP_ANSI_COLOR="0;34"
|
||||
EXP_CPE_NAME="cpe:/o:fedoraproject:fedora-modular:26"
|
||||
EXP_HOME_URL="https://fedoraproject.org/"
|
||||
EXP_BUG_REPORT_URL="https://bugzilla.redhat.com/"
|
||||
EXP_REDHAT_BUGZILLA_PRODUCT="Fedora"
|
||||
EXP_REDHAT_BUGZILLA_PRODUCT_VERSION="26"
|
||||
EXP_REDHAT_SUPPORT_PRODUCT="Fedora"
|
||||
EXP_REDHAT_SUPPORT_PRODUCT_VERSION="26"
|
||||
EXP_PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
|
||||
|
||||
if [[ $NAME != $EXP_NAME ]]; then
|
||||
echo "FAIL: Expected NAME to be '$EXP_NAME', but it is '$NAME'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $VERSION != $EXP_VERSION ]]; then
|
||||
echo "FAIL: Expected VERSION to be '$EXP_VERSION', but it is '$VERSION'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $ID != $EXP_ID ]]; then
|
||||
echo "FAIL: Expected ID to be '$EXP_ID', but it is '$ID'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $ID_LIKE != $EXP_ID_LIKE ]]; then
|
||||
echo "FAIL: Expected ID_LIKE to be '$EXP_ID_LIKE', but it is '$ID_LIKE'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $VERSION_ID != $EXP_VERSION_ID ]]; then
|
||||
echo "FAIL: Expected VERSION_ID to be '$EXP_VERSION_ID', but it is '$VERSION_ID'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $PRETTY_NAME != $EXP_PRETTY_NAME ]]; then
|
||||
echo "FAIL: Expected PRETTY_NAME to be '$EXP_PRETTY_NAME', but it is '$PRETTY_NAME'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $ANSI_COLOR != $EXP_ANSI_COLOR ]]; then
|
||||
echo "FAIL: Expected ANSI_COLOR to be '$EXP_ANSI_COLOR', but it is '$ANSI_COLOR'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $CPE_NAME != $EXP_CPE_NAME ]]; then
|
||||
echo "FAIL: Expected CPE_NAME to be '$EXP_CPE_NAME', but it is '$CPE_NAME'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $HOME_URL != $EXP_HOME_URL ]]; then
|
||||
echo "FAIL: Expected HOME_URL to be '$EXP_HOME_URL', but it is '$HOME_URL'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $BUG_REPORT_URL != $EXP_BUG_REPORT_URL ]]; then
|
||||
echo "FAIL: Expected BUG_REPORT_URL to be '$EXP_BUG_REPORT_URL', but it is '$BUG_REPORT_URL'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $REDHAT_BUGZILLA_PRODUCT != $EXP_REDHAT_BUGZILLA_PRODUCT ]]; then
|
||||
echo "FAIL: Expected REDHAT_BUGZILLA_PRODUCT to be '$EXP_REDHAT_BUGZILLA_PRODUCT', but it is '$REDHAT_BUGZILLA_PRODUCT'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $REDHAT_BUGZILLA_PRODUCT_VERSION != $EXP_REDHAT_BUGZILLA_PRODUCT_VERSION ]]; then
|
||||
echo "FAIL: Expected REDHAT_BUGZILLA_PRODUCT_VERSION to be '$EXP_REDHAT_BUGZILLA_PRODUCT_VERSION', but it is '$REDHAT_BUGZILLA_PRODUCT_VERSION'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $REDHAT_SUPPORT_PRODUCT != $EXP_REDHAT_SUPPORT_PRODUCT ]]; then
|
||||
echo "FAIL: Expected REDHAT_SUPPORT_PRODUCT to be '$EXP_REDHAT_SUPPORT_PRODUCT', but it is '$REDHAT_SUPPORT_PRODUCT'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $REDHAT_SUPPORT_PRODUCT_VERSION != $EXP_REDHAT_SUPPORT_PRODUCT_VERSION ]]; then
|
||||
echo "FAIL: Expected REDHAT_SUPPORT_PRODUCT_VERSION to be '$EXP_REDHAT_SUPPORT_PRODUCT_VERSION', but it is '$REDHAT_SUPPORT_PRODUCT_VERSION'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $PRIVACY_POLICY_URL != $EXP_PRIVACY_POLICY_URL ]]; then
|
||||
echo "FAIL: Expected PRIVACY_POLICY_URL to be '$EXP_PRIVACY_POLICY_URL', but it is '$PRIVACY_POLICY_URL'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue