From b00f66b3f6446abbe37ac99451fe98c78e88bd0c Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 5 Dec 2022 15:10:50 +0100 Subject: [PATCH] Move behave tests from Kanku to Podman, run them in GitHub actions --- .../workflows/{unittests.yaml => tests.yaml} | 29 +++- behave/Containerfile | 32 +++++ behave/KankuFile | 91 ------------- behave/README.md | 65 +++++---- behave/container-build.sh | 9 ++ behave/container-oscrc | 7 + behave/container-run.sh | 18 +++ behave/container-setup-common.sh | 39 ++++++ behave/container-setup-initial-data.sh | 109 +++++++++++++++ behave/container-setup-prebuilt-rpms.sh | 97 +++++++++++++ behave/container-setup.sh | 127 ++++++++++++++++++ behave/container-shell.sh | 9 ++ behave/features/add.feature | 1 - behave/features/checkout.feature | 1 - behave/features/environment.py | 28 ++-- ...ies-project-package-repo-arch-file.feature | 23 ++-- ...binaries-project-package-repo-arch.feature | 13 +- .../getbinaries-project-repo-arch.feature | 29 ++-- .../getbinaries-repo-arch-pkgcheckout.feature | 11 +- .../getbinaries-repo-arch-prjcheckout.feature | 49 ++++--- .../getbinaries-repo-pkgcheckout.feature | 21 ++- .../getbinaries-repo-prjcheckout.feature | 75 +++++------ behave/features/list.feature | 3 +- behave/features/steps/kanku.py | 76 ----------- behave/features/steps/osc.py | 46 ++++--- behave/features/steps/podman.py | 68 ++++++++++ behave/fixtures/pac/multibuild-pkg-1.spec | 4 +- behave/fixtures/pac/test-pkgA-1.spec | 2 +- behave/fixtures/pac/test-pkgA-2.spec | 2 +- behave/fixtures/pac/test-pkgA-3.spec | 2 +- behave/fixtures/pac/test-pkgB-1.spec | 2 +- behave/fixtures/pac/test-pkgB-2.spec | 2 +- behave/fixtures/prj/devel.xml | 26 ++++ behave/fixtures/prj/home_Admin.xml | 12 ++ behave/fixtures/prj/openSUSE_Factory.xml | 12 ++ behave/fixtures/prj/release.xml | 28 ++++ behave/obs-setup/environment.py | 20 --- behave/obs-setup/obs-setup.feature | 113 ---------------- behave/obs-setup/steps | 1 - behave/requirements.spec | 46 ------- behave/requirements.txt | 1 - 41 files changed, 818 insertions(+), 531 deletions(-) rename .github/workflows/{unittests.yaml => tests.yaml} (80%) create mode 100644 behave/Containerfile delete mode 100644 behave/KankuFile create mode 100755 behave/container-build.sh create mode 100644 behave/container-oscrc create mode 100755 behave/container-run.sh create mode 100644 behave/container-setup-common.sh create mode 100644 behave/container-setup-initial-data.sh create mode 100644 behave/container-setup-prebuilt-rpms.sh create mode 100644 behave/container-setup.sh create mode 100755 behave/container-shell.sh delete mode 100644 behave/features/steps/kanku.py create mode 100644 behave/features/steps/podman.py create mode 100644 behave/fixtures/prj/devel.xml create mode 100644 behave/fixtures/prj/release.xml delete mode 100644 behave/obs-setup/environment.py delete mode 100644 behave/obs-setup/obs-setup.feature delete mode 120000 behave/obs-setup/steps delete mode 100644 behave/requirements.spec delete mode 100644 behave/requirements.txt diff --git a/.github/workflows/unittests.yaml b/.github/workflows/tests.yaml similarity index 80% rename from .github/workflows/unittests.yaml rename to .github/workflows/tests.yaml index 8767ec27..74ff8139 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -name: 'unit tests' +name: 'tests' on: push: @@ -15,8 +15,8 @@ on: - 'tests/**' jobs: - test: - name: 'unit tests' + unit: + name: "unit" runs-on: 'ubuntu-latest' strategy: fail-fast: false @@ -91,3 +91,26 @@ jobs: - name: 'Upload coverage reports to Codecov (openSUSE Tumbleweed)' if: ${{ matrix.container == 'opensuse/tumbleweed' }} uses: codecov/codecov-action@v3 + + behave: + name: "behave" + # to save resources, run only after unit tests have passed + needs: unit + runs-on: "ubuntu-latest" + steps: + - name: "Install packages" + run: | + sudo apt-get -y update + sudo apt-get -y --no-install-recommends install python3-behave diffstat diffutils python3 python3-cryptography python3-pip python3-rpm python3-setuptools python3-urllib3 + + - name: "Checkout sources" + uses: actions/checkout@v3 + + - name: "Pull container image" + run: | + podman pull ghcr.io/suse-autobuild/obs-server:latest + + - name: "Run tests" + run: | + cd behave + behave -Dosc=../osc-wrapper.py diff --git a/behave/Containerfile b/behave/Containerfile new file mode 100644 index 00000000..eeffcee7 --- /dev/null +++ b/behave/Containerfile @@ -0,0 +1,32 @@ +FROM opensuse/leap:15.4 + +RUN zypper ar --repo http://download.opensuse.org/repositories/OBS:/Server:/Unstable/15.4/OBS:Server:Unstable.repo +RUN zypper -n --gpg-auto-import-keys refresh +RUN zypper -n install \ + bash \ + bash-completion \ + git \ + less \ + obs-api \ + obs-server \ + obs-signd \ + obs-worker \ + osc \ + openslp \ + openssl \ + perl-XML-SAX \ + rpm-build \ + systemd \ + vim \ + && rm -rf /var/cache/zypp/* + +# increase the number if we need to run the following setup steps again (for debugging purposes) +ENV BUILD_NUMBER 1 + +RUN /bin/bash /opt/obs/container-setup.sh +COPY container-oscrc /root/.config/osc/oscrc +RUN /bin/bash /opt/obs/container-setup-initial-data.sh +RUN /bin/bash /opt/obs/container-setup-prebuilt-rpms.sh + +# /sbin/init doesn't exist on Leap 15.4 +ENTRYPOINT ["/usr/lib/systemd/systemd"] diff --git a/behave/KankuFile b/behave/KankuFile deleted file mode 100644 index 176f3247..00000000 --- a/behave/KankuFile +++ /dev/null @@ -1,91 +0,0 @@ -domain_name: obs-server -default_job: kanku-job -login_user: root -login_pass: opensuse - -jobs: - kanku-job: - - - use_module: Kanku::Handler::SetJobContext - options: - host_interface: eth0 - - - use_module: Kanku::Handler::OBSCheck - options: - api_url: https://api.opensuse.org/public - # Please have a look at - # kanku lsi - # to find more official Images - project: OBS:Server:Unstable - package: OBS-Appliance:qcow2 - repository: images - arch: x86_64 - use_oscrc: 0 - - - use_module: Kanku::Handler::ImageDownload - - - use_module: Kanku::Handler::CreateDomain - options: - memory: 5G - vcpu: 4 - use_9p: 1 - - - use_module: Kanku::Handler::PrepareSSH - - - use_module: Kanku::Handler::ExecuteCommandViaSSH - options: - commands: - # fix the following error in scheduler: unknown host 'obs-server.kanku.site' - - echo "127.0.0.1 obs-server.kanku.site" >> /etc/hosts - - echo "::1 obs-server.kanku.site" >> /etc/hosts - - # disable OBS:Server:Unstable, we want to install only stable packages from now on - - zypper --non-interactive modifyrepo --disable OBS:Server:Unstable - - # refresh repodata and install additional packages - - zypper --non-interactive --gpg-auto-import-keys refresh - - zypper --non-interactive install bash-completion rpm-build sudo - - # reinstall osc with a stable version - - zypper --non-interactive install --force osc - - # install test requirements - - rpmbuild -bs --define='_srcrpmdir /opt/' --without=host_only_packages /tmp/kanku/requirements.spec - - zypper --non-interactive source-install --build-deps-only /opt/osc-behave-requirements-1-0.src.rpm - - # zramswap for more available memory - - zypper --non-interactive install systemd-zram-service - - systemctl enable zramswap - - # decrease number of workers - - sed -i 's@^OBS_WORKER_INSTANCES=.*@OBS_WORKER_INSTANCES="1"@' /etc/sysconfig/obs-server - - # configure OBS URL (for osc browse) - - echo "UPDATE configurations SET obs_url='https://obs-server.kanku.site';" | mysql api_production - - # configure download URL - - echo "UPDATE configurations SET download_url='http://obs-server.kanku.site:82';" | mysql api_production - - # write configuration from the database on disk - - cd /srv/www/obs/api; RAILS_ENV=production SAFETY_ASSURED=1 bin/rails writeconfiguration - - - use_module: Kanku::Handler::Reboot - # Reboot to restart obs services. - # Restarting them via systemctl doesn't always work, it ends up with the following error: - # > scheduler is already running for ! - # We also need them restarted because they're failing on unresolvable obs-server.kanku.site. - - - use_module: Kanku::Handler::ExecuteCommandViaSSH - options: - commands: - # use behave to setup OBS - create projects and packages - - cd /tmp/kanku && behave obs-setup - - # unmount /tmp/kanku so we are able to create a snapshot of the VM - - umount /tmp/kanku - - - use_module: Kanku::Handler::DomainSnapshot - options: - # create a snapshot we'll use as a starting point for running tests - command: create - name: current diff --git a/behave/README.md b/behave/README.md index f2a95256..94e33333 100644 --- a/behave/README.md +++ b/behave/README.md @@ -1,49 +1,66 @@ -Prerequisities --------------- -First of all, we need to install requirements: -``` -# optional step in case we want to use the latest kanku packages -$ zypper ar obs://devel:kanku:staging devel:kanku:staging +Install requirements +-------------------- +On openSUSE: +``` +$ zypper install osc podman python3-behave +``` + +On Fedora: +``` +$ dnf install osc podman python3-behave +``` + + +Build a container with OBS +-------------------------- + +``` $ cd behave -$ rpmbuild -bs --define='_srcrpmdir .' requirements.spec -$ sudo zypper source-install --build-deps-only ./osc-behave-requirements-1-0.src.rpm + +# optional: refresh the base image +$ podman pull opensuse/leap:15.4 + +# build the container image +$ ./container-build.sh [--no-cache] ``` -Then we need to build 'obs-server' VM using kanku: +We can also use the built container outside the test suite ``` -# necessary if the 'obs-server' domain exists already -$ kanku destroy +$ cd behave -$ kanku up [--skip_all_checks] +# run 'obs-server' container on port 1443 +$ ./container-run.sh + +# shell into the started container +$ ./container-shell.sh + +# stop the started container +$ podman stop|kill obs-server + +# remove container image +$ podman rmi obs-server ``` - -Running tests -------------- +Run tests +--------- Run all tests ``` $ cd behave -$ behave +$ behave -Dosc=../osc-wrapper.py ``` Run selected tests ``` $ cd behave -$ behave features/.feature +$ behave -Dosc=../osc-wrapper.py features/.feature ``` Run tests being worked on (decorated with `@wip`) ``` $ cd behave -behave --wip -k -``` - -Run tests with the selected `osc` executable -``` -$ cd behave -behave -Dosc=../osc-wrapper.py +behave -Dosc=../osc-wrapper.py --wip -k ``` diff --git a/behave/container-build.sh b/behave/container-build.sh new file mode 100755 index 00000000..7f2afede --- /dev/null +++ b/behave/container-build.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +TOPDIR=$(dirname $(readlink -f $0)) + +podman build "$@" \ + --tag obs-server \ + --volume="$TOPDIR":/opt/obs \ + $TOPDIR \ + 2>&1 | tee container-build.log diff --git a/behave/container-oscrc b/behave/container-oscrc new file mode 100644 index 00000000..3f38ee33 --- /dev/null +++ b/behave/container-oscrc @@ -0,0 +1,7 @@ +[general] +apiurl = https://localhost + +[https://localhost] +user=Admin +pass=opensuse +credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager diff --git a/behave/container-run.sh b/behave/container-run.sh new file mode 100755 index 00000000..9c319273 --- /dev/null +++ b/behave/container-run.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +TOPDIR=$(dirname $(readlink -f $0)) + +podman run \ + --name obs-server \ + --hostname obs-server \ + --replace \ + --detach \ + --interactive \ + --tty \ + --volume="$TOPDIR":/opt/obs \ + --cap-add SYS_PTRACE \ + -p 1443:443 \ + obs-server + +sleep 0.5 +podman exec -it obs-server /usr/bin/systemctl is-system-running --wait diff --git a/behave/container-setup-common.sh b/behave/container-setup-common.sh new file mode 100644 index 00000000..fbb0d2d6 --- /dev/null +++ b/behave/container-setup-common.sh @@ -0,0 +1,39 @@ +set -x +set -e + + +MYSQL_HELPER=/usr/libexec/mysql/mysql-systemd-helper +if [ ! -f "$MYSQL_HELPER" ]; then + MYSQL_HELPER=/usr/lib/mysql/mysql-systemd-helper +fi + + +function init_mysql { + "$MYSQL_HELPER" install + "$MYSQL_HELPER" upgrade +} + + +function start_mysql { + su --shell=/bin/bash - mysql "$MYSQL_HELPER" start 2>&1 >/dev/null & +} + + +function start_apache { + /usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start & +} + + +function start_obs_repserver { + /usr/lib/obs/server/bs_repserver --logfile rep_server.log 2>&1 >/dev/null & +} + + +function start_obs_srcserver { + /usr/lib/obs/server/bs_srcserver --logfile src_server.log 2>&1 >/dev/null & +} + + +function start_obs_scheduler { + /usr/sbin/obsscheduler start +} diff --git a/behave/container-setup-initial-data.sh b/behave/container-setup-initial-data.sh new file mode 100644 index 00000000..636d65cd --- /dev/null +++ b/behave/container-setup-initial-data.sh @@ -0,0 +1,109 @@ +set -x +set -e + + +TOPDIR=$(dirname $(readlink -f "$0")) +source "$TOPDIR/container-setup-common.sh" + + +start_mysql +start_apache +start_obs_srcserver +sleep 1 + + +FIXTURES_DIR="$TOPDIR/fixtures" +OSC="osc -A https://localhost" + + +# create projects +$OSC api -X PUT '/source/openSUSE.org/_meta' --file "$FIXTURES_DIR/prj/openSUSE.org.xml" +$OSC api -X PUT '/source/devel/_meta' --file "$FIXTURES_DIR/prj/devel.xml" +$OSC api -X PUT '/source/release/_meta' --file "$FIXTURES_DIR/prj/release.xml" +$OSC api -X PUT '/source/openSUSE:Factory/_meta' --file "$FIXTURES_DIR/prj/openSUSE_Factory.xml" +$OSC api -X PUT '/source/home:Admin/_meta' --file "$FIXTURES_DIR/prj/home_Admin.xml" + + +# create package 'openSUSE:Factory/test-pkgA' +TMP_DIR=$(mktemp -d) +cd "$TMP_DIR" + +$OSC checkout openSUSE:Factory +cd "$_" + +$OSC mkpac test-pkgA +cd "$_" + +cp "$FIXTURES_DIR/pac/test-pkgA-1.spec" test-pkgA.spec +cp "$FIXTURES_DIR/pac/test-pkgA-1.changes" test-pkgA.changes +$OSC add test-pkgA.spec test-pkgA.changes +$OSC commit -m 'Initial commit' + +cp "$FIXTURES_DIR/pac/test-pkgA-2.spec" test-pkgA.spec +cp "$FIXTURES_DIR/pac/test-pkgA-2.changes" test-pkgA.changes +$OSC commit -m 'Version 2' + +cp "$FIXTURES_DIR/pac/test-pkgA-3.spec" test-pkgA.spec +cp "$FIXTURES_DIR/pac/test-pkgA-3.changes" test-pkgA.changes +$OSC commit -m 'Version 3' + +rm -rf "$TMP_DIR" + + +# create package 'openSUSE:Factory/test-pkgB' +TMP_DIR=$(mktemp -d) +cd "$TMP_DIR" + +$OSC checkout openSUSE:Factory +cd "$_" + +$OSC mkpac test-pkgB +cd "$_" + +cp "$FIXTURES_DIR/pac/test-pkgB-1.spec" test-pkgB.spec +cp "$FIXTURES_DIR/pac/test-pkgB-1.changes" test-pkgB.changes +$OSC add test-pkgB.spec test-pkgB.changes +$OSC commit -m 'Initial commit' + +cp "$FIXTURES_DIR/pac/test-pkgB-2.spec" test-pkgB.spec +cp "$FIXTURES_DIR/pac/test-pkgB-2.changes" test-pkgB.changes +$OSC commit -m 'Version 2' + +rm -rf "$TMP_DIR" + + +# create package 'openSUSE:Factory/multibuild-pkg' +TMP_DIR=$(mktemp -d) +cd "$TMP_DIR" + +$OSC checkout openSUSE:Factory +cd "$_" + +$OSC mkpac multibuild-pkg +cd "$_" + +cp "$FIXTURES_DIR/pac/multibuild-pkg-1._multibuild" _multibuild +cp "$FIXTURES_DIR/pac/multibuild-pkg-1.spec" multibuild-pkg.spec +cp "$FIXTURES_DIR/pac/multibuild-pkg-1.changes" multibuild-pkg.changes + +$OSC add _multibuild multibuild-pkg.spec multibuild-pkg.changes +$OSC commit -m 'Initial commit' + +rm -rf "$TMP_DIR" + + +# create package 'devel/test-pkgA' +TMP_DIR=$(mktemp -d) +cd "$TMP_DIR" + +$OSC checkout devel +cd "$_" + +$OSC mkpac test-pkgA +cd "$_" + +# commit an empty package +$OSC commit -m 'Initial commit' + +# set the devel project +$OSC setdevelproject openSUSE:Factory/test-pkgA devel/test-pkgA diff --git a/behave/container-setup-prebuilt-rpms.sh b/behave/container-setup-prebuilt-rpms.sh new file mode 100644 index 00000000..16c227fe --- /dev/null +++ b/behave/container-setup-prebuilt-rpms.sh @@ -0,0 +1,97 @@ +set -x +set -e + + +TOPDIR=$(dirname $(readlink -f "$0")) +source "$TOPDIR/container-setup-common.sh" + + +start_obs_srcserver +start_obs_repserver +sleep 1 + + +FIXTURES_DIR="$TOPDIR/fixtures" + + +function upload_rpms() { + local TMP_DIR=$(mktemp -d) + local RPM_DIR="$1" + local PROJECT="$2" + local REPO="$3" + local ARCH="$4" + local PACKAGE="$5" + + # scan directory for all RPMs and link them to a flat dir to avoid + # 400 remote error: cpio filename contains a '/' + find "$RPM_DIR/SRPMS" -name '*.rpm' -exec ln -s {} "$TMP_DIR/" \; || : + find "$RPM_DIR/RPMS/noarch" -name '*.rpm' -exec ln -s {} "$TMP_DIR/" \; || : + find "$RPM_DIR/RPMS/$ARCH" -name '*.rpm' -exec ln -s {} "$TMP_DIR/" \; || : + pushd "$TMP_DIR" + find -name '*.rpm' | cpio --create --dereference -H newc > upload.cpio + curl \ + --data-binary '@upload.cpio' \ + -H 'X-username: Admin' \ + -H 'Content-Type: application/x-cpio' \ + "http://localhost:5352/build/$PROJECT/$REPO/$ARCH/$PACKAGE" + rm -rf "$TMP_DIR" + popd +} + + +# build package 'openSUSE:Factory/test-pkgA' +TMP_DIR=$(mktemp -d) +rpmbuild -ba "$FIXTURES_DIR/pac/test-pkgA-3.spec" --define "_topdir $TMP_DIR" +upload_rpms "$TMP_DIR" openSUSE:Factory standard i586 test-pkgA +upload_rpms "$TMP_DIR" openSUSE:Factory standard x86_64 test-pkgA +rm -rf "$TMP_DIR" + + +# build package 'openSUSE:Factory/test-pkgB' +TMP_DIR=$(mktemp -d) +rpmbuild -ba "$FIXTURES_DIR/pac/test-pkgB-2.spec" --define "_topdir $TMP_DIR" +upload_rpms "$TMP_DIR" openSUSE:Factory standard i586 test-pkgB +upload_rpms "$TMP_DIR" openSUSE:Factory standard x86_64 test-pkgB +rm -rf "$TMP_DIR" + + +# build package 'openSUSE:Factory/multibuild-pkg' +TMP_DIR=$(mktemp -d) +rpmbuild -ba "$FIXTURES_DIR/pac/multibuild-pkg-1.spec" --define "_topdir $TMP_DIR" --target=x86_64,i586 --define "flavor %{nil}" +upload_rpms "$TMP_DIR" openSUSE:Factory standard i586 multibuild-pkg +upload_rpms "$TMP_DIR" openSUSE:Factory standard x86_64 multibuild-pkg +rm -rf "$TMP_DIR" + + +# build package 'openSUSE:Factory/multibuild-pkg:flavor1' +TMP_DIR=$(mktemp -d) +rpmbuild -ba "$FIXTURES_DIR/pac/multibuild-pkg-1.spec" --define "_topdir $TMP_DIR" --target=x86_64,i586 --define "flavor flavor1" +upload_rpms "$TMP_DIR" openSUSE:Factory standard i586 multibuild-pkg:flavor1 +upload_rpms "$TMP_DIR" openSUSE:Factory standard x86_64 multibuild-pkg:flavor1 +rm -rf "$TMP_DIR" + + +# build package 'openSUSE:Factory/multibuild-pkg:flavor2' +TMP_DIR=$(mktemp -d) +rpmbuild -ba "$FIXTURES_DIR/pac/multibuild-pkg-1.spec" --define "_topdir $TMP_DIR" --target=x86_64,i586 --define "flavor flavor2" +upload_rpms "$TMP_DIR" openSUSE:Factory standard i586 multibuild-pkg:flavor2 +upload_rpms "$TMP_DIR" openSUSE:Factory standard x86_64 multibuild-pkg:flavor2 +rm -rf "$TMP_DIR" + + +# run scheduler to process all jobs +/usr/lib/obs/server/bs_sched --testmode i586 +/usr/lib/obs/server/bs_sched --testmode x86_64 + + +# create fake empty files that usually accompany RPMs +ARCHES="i586 x86_64" +PACKAGES="test-pkgA test-pkgB multibuild-pkg multibuild-pkg:flavor1 multibuild-pkg:flavor2" +FILES="_buildenv _statistics rpmlint.log" +for ARCH in $ARCHES; do + for PACKAGE in $PACKAGES; do + for FILE in $FILES; do + touch /srv/obs/build/openSUSE:Factory/standard/$ARCH/$PACKAGE/$FILE + done + done +done diff --git a/behave/container-setup.sh b/behave/container-setup.sh new file mode 100644 index 00000000..96ec87e8 --- /dev/null +++ b/behave/container-setup.sh @@ -0,0 +1,127 @@ +set -x +set -e + + +TOPDIR=$(dirname $(readlink -f "$0")) +source "$TOPDIR/container-setup-common.sh" + + +# tweak configuration + +# hard-code hostname to "localhost" +sed -i 's!^my $hostname = .*!my $hostname = "localhost";!' /usr/lib/obs/server/BSConfig.pm + +# set signd server to "localhost" (workarounds the "will not proxy to myself" error) +sed -i 's!^#server: .*!server: localhost!' /etc/sign.conf + +# limit number of workers +sed -i 's!^OBS_WORKER_INSTANCES=.*!OBS_WORKER_INSTANCES="1"!' /etc/sysconfig/obs-server + +# enable xforward +sed -i 's!^#use_xforward:.*!use_xforward: true!' /srv/www/obs/api/config/options.yml + +# configure passenger +sed -i -E 's!^(\s*)PassengerRuby .*!\1PassengerRuby "/usr/bin/ruby.ruby3.1"!' /etc/apache2/conf.d/mod_passenger.conf + +# enable apache SSL server flag +sed -i 's!^APACHE_SERVER_FLAGS=.*!APACHE_SERVER_FLAGS="SSL"!' /etc/sysconfig/apache2 + + +# enable apache mods +APACHE_MODS="passenger rewrite proxy proxy_http xforward headers ssl socache_shmcb" +for mod in $APACHE_MODS; do + /usr/sbin/a2enmod $mod +done + + +# create missing dirs, set perms +mkdir -p /srv/obs/repos +chown obsrun:obsrun /srv/obs/repos +chmod 0755 /srv/obs/repos + +mkdir -p /srv/obs/certs +chown root:root /srv/obs/certs +chmod 0700 /srv/obs/certs + + +# create a self-signed certificate for 'localhost' +cd /srv/obs/certs +openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -addext "subjectAltName = DNS:localhost" -out server.crt -keyout server.key -subj '/CN=localhost' + + +# copy server cert into osc's trusted certs +mkdir -p /root/.config/osc/trusted-certs +cp /srv/obs/certs/server.crt /root/.config/osc/trusted-certs/localhost_443.pem + + +# configure mysql +cat < /etc/my.cnf.d/obs-server.cnf +[mysqld] +bind-address = 127.0.0.1 +datadir = /srv/obs/MySQL + +[mysqld_multi] +datadir = /srv/obs/MySQL +EOF + + +# mysql user's home +mkdir -p /var/lib/mysql +chown mysql:mysql /var/lib/mysql +chmod 0700 /var/lib/mysql + +# datadir for OBS +mkdir -p /srv/obs/MySQL +chown mysql:mysql /srv/obs/MySQL +chmod 0700 /srv/obs/MySQL + + +# initialize database +init_mysql +start_mysql +sleep 1 + + +# set mysql superuser's password; user=root, password=opensuse +mysqladmin -u root password opensuse +echo "ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('opensuse');" | mysql + + +# start srcserver (needed for OBS initialization) +start_obs_srcserver + + +# initialize the OBS database +cd /srv/www/obs/api +RAILS_ENV=production SAFETY_ASSURED=1 bin/rails db:setup writeconfiguration data:schema:load + + +# fix perms +chown -R wwwrun:www /srv/www/obs/api/log/ +chown -R wwwrun:www /srv/www/obs/api/tmp/ + + +# OBS api +#systemctl enable memcached +systemctl enable apache2 +systemctl enable mysql +# starting obs-api-support.target incl. all dependencies is expensive +# let's start it only when needed +# systemctl enable obs-api-support.target + +# OBS backend +systemctl enable obssrcserver +systemctl enable obsrepserver +#systemctl enable obsdispatcher +#systemctl enable obspublisher +#systemctl enable obsscheduler +#systemctl enable obsservice +#systemctl enable obssignd +#systemctl enable obssigner +#systemctl enable obswarden +#systemctl enable obsdodup +#systemctl enable obsdeltastore +#systemctl enable obsservicedispatch + +# OBS worker +# systemctl enable obsworker diff --git a/behave/container-shell.sh b/behave/container-shell.sh new file mode 100755 index 00000000..9d648da0 --- /dev/null +++ b/behave/container-shell.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +TOPDIR=$(dirname $(readlink -f $0)) + +podman exec \ + --interactive \ + --tty \ + obs-server \ + /bin/bash diff --git a/behave/features/add.feature b/behave/features/add.feature index 91bd63e6..fe2f1d05 100644 --- a/behave/features/add.feature +++ b/behave/features/add.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc add` command diff --git a/behave/features/checkout.feature b/behave/features/checkout.feature index a9f307ca..956ac967 100644 --- a/behave/features/checkout.feature +++ b/behave/features/checkout.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc checkout` command diff --git a/behave/features/environment.py b/behave/features/environment.py index a8723b14..4650ddf7 100644 --- a/behave/features/environment.py +++ b/behave/features/environment.py @@ -1,8 +1,8 @@ import os -from steps import kanku -from steps import osc from steps import common +from steps import osc +from steps import podman def before_step(context, step): @@ -14,18 +14,20 @@ def after_step(context, step): def before_scenario(context, scenario): - context.osc = osc.Osc(context) + pass def after_scenario(context, scenario): + if "destructive" in scenario.tags: + # start a new container after a destructive test + context.podman.kill() + context.podman = podman.Podman() + context.osc.clear() common.check_exit_code(context) - del context.osc def before_feature(context, feature): - # decorate Feature with @no-snapshot to avoid doing a snapshot rollback - if "no-snapshot" not in feature.tags: - context.kanku.revert_to_snapshot() + pass def after_feature(context, feature): @@ -44,14 +46,12 @@ def before_all(context): # absolute path to .../behave/fixtures context.fixtures = os.path.join(os.path.dirname(__file__), "..", "fixtures") - kankufile = os.path.join(os.path.dirname(__file__), "..", "KankuFile") - context.kanku = kanku.Kanku(context, kankufile) - - # This fails if the snapshot exists already. - # It's ok in most cases, because it's the same snapshot we'd normally create. - context.kanku.create_snapshot() + context.podman = podman.Podman() + context.osc = osc.Osc(context) def after_all(context): - del context.kanku + del context.osc + context.podman.kill() + del context.podman del context.fixtures diff --git a/behave/features/getbinaries-project-package-repo-arch-file.feature b/behave/features/getbinaries-project-package-repo-arch-file.feature index 3e0ef601..14335158 100644 --- a/behave/features/getbinaries-project-package-repo-arch-file.feature +++ b/behave/features/getbinaries-project-package-repo-arch-file.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command @@ -8,54 +7,54 @@ Background: Scenario: Run `osc getbinaries ` - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-1-1.1.x86_64.rpm" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-1-1.x86_64.rpm" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm + multibuild-pkg-1-1.x86_64.rpm """ Scenario: Run `osc getbinaries --multibuild-package=` - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-flavor1-1-1.1.x86_64.rpm --multibuild-package=flavor1" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-flavor1-1-1.x86_64.rpm --multibuild-package=flavor1" # the option is allowed only in a package checkout Then the exit code is 2 Scenario: Run `osc getbinaries : ` where file is a package - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg:flavor1 standard x86_64 multibuild-pkg-flavor1-1-1.1.x86_64.rpm" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg:flavor1 standard x86_64 multibuild-pkg-flavor1-1-1.x86_64.rpm" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-flavor1-1-1.1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm """ Scenario: Run `osc getbinaries ` where file is a source package - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-1-1.1.src.rpm" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-1-1.src.rpm" Then directory listing of "{context.osc.temp}/binaries/" is """ """ Scenario: Run `osc getbinaries --source` where file is a source package - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-1-1.1.src.rpm --source" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-1-1.src.rpm --source" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-1-1.1.src.rpm + multibuild-pkg-1-1.src.rpm """ Scenario: Run `osc getbinaries ` where file is a debuginfo package - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-debuginfo-1-1.1.x86_64.rpm" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-debuginfo-1-1.x86_64.rpm" Then directory listing of "{context.osc.temp}/binaries/" is """ """ Scenario: Run `osc getbinaries --debuginfo` where file is a debuginfo package - When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-debuginfo-1-1.1.x86_64.rpm --debuginfo" + When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64 multibuild-pkg-debuginfo-1-1.x86_64.rpm --debuginfo" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-debuginfo-1-1.1.x86_64.rpm + multibuild-pkg-debuginfo-1-1.x86_64.rpm """ diff --git a/behave/features/getbinaries-project-package-repo-arch.feature b/behave/features/getbinaries-project-package-repo-arch.feature index 8fbe4808..c8489489 100644 --- a/behave/features/getbinaries-project-package-repo-arch.feature +++ b/behave/features/getbinaries-project-package-repo-arch.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command @@ -11,7 +10,7 @@ Scenario: Run `osc getbinaries ` When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg standard x86_64" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm + multibuild-pkg-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -28,7 +27,7 @@ Scenario: Run `osc getbinaries : ` When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg:flavor1 standard x86_64" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-flavor1-1-1.1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -39,8 +38,8 @@ Scenario: Run `osc getbinaries : --sour When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg:flavor1 standard x86_64 --source" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -51,8 +50,8 @@ Scenario: Run `osc getbinaries : --debu When I execute osc with args "getbinaries openSUSE:Factory multibuild-pkg:flavor1 standard x86_64 --debuginfo" Then directory listing of "{context.osc.temp}/binaries/" is """ - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-debuginfo-1-1.1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor1-debuginfo-1-1.x86_64.rpm _buildenv _statistics rpmlint.log diff --git a/behave/features/getbinaries-project-repo-arch.feature b/behave/features/getbinaries-project-repo-arch.feature index 8e149e64..1d267978 100644 --- a/behave/features/getbinaries-project-repo-arch.feature +++ b/behave/features/getbinaries-project-repo-arch.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command @@ -11,11 +10,11 @@ Scenario: Run `osc getbinaries ` When I execute osc with args "getbinaries openSUSE:Factory standard x86_64" Then directory tree in "{context.osc.temp}/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgB-2-1.1.noarch.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgB-2-1.noarch.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log @@ -44,15 +43,15 @@ Scenario: Run `osc getbinaries --debuginfo` When I execute osc with args "getbinaries openSUSE:Factory standard x86_64 --debuginfo" Then directory tree in "{context.osc.temp}/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-debugsource-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-debuginfo-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgB-2-1.1.noarch.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-debuginfo-1-1.x86_64.rpm + multibuild-pkg-debugsource-1-1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor1-debuginfo-1-1.x86_64.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + multibuild-pkg-flavor2-debuginfo-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgB-2-1.noarch.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log diff --git a/behave/features/getbinaries-repo-arch-pkgcheckout.feature b/behave/features/getbinaries-repo-arch-pkgcheckout.feature index 0dbc132c..279c355e 100644 --- a/behave/features/getbinaries-repo-arch-pkgcheckout.feature +++ b/behave/features/getbinaries-repo-arch-pkgcheckout.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command from a package checkout @@ -13,7 +12,7 @@ Scenario: Run `osc getbinaries ` from a package checkout When I execute osc with args "getbinaries standard x86_64" Then directory listing of "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm + multibuild-pkg-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -24,7 +23,7 @@ Scenario: Run `osc getbinaries --multibuild-package=` from When I execute osc with args "getbinaries standard x86_64 --multibuild-package=flavor1" Then directory listing of "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/binaries/" is """ - multibuild-pkg-flavor1-1-1.1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -35,9 +34,9 @@ Scenario: Run `osc getbinaries --debuginfo` from a package checkou When I execute osc with args "getbinaries standard x86_64 --debuginfo" Then directory listing of "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-debugsource-1-1.1.x86_64.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-debuginfo-1-1.x86_64.rpm + multibuild-pkg-debugsource-1-1.x86_64.rpm _buildenv _statistics rpmlint.log diff --git a/behave/features/getbinaries-repo-arch-prjcheckout.feature b/behave/features/getbinaries-repo-arch-prjcheckout.feature index ae185843..d04044fe 100644 --- a/behave/features/getbinaries-repo-arch-prjcheckout.feature +++ b/behave/features/getbinaries-repo-arch-prjcheckout.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command from a project checkout @@ -13,11 +12,11 @@ Scenario: Run `osc getbinaries ` from a project checkout When I execute osc with args "getbinaries standard x86_64" Then directory tree in "{context.osc.temp}/openSUSE:Factory/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgB-2-1.1.noarch.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgB-2-1.noarch.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log @@ -46,16 +45,16 @@ Scenario: Run `osc getbinaries --sources` from a project checkout When I execute osc with args "getbinaries standard x86_64 --sources" Then directory tree in "{context.osc.temp}/openSUSE:Factory/binaries/" is """ - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgA-3-1.1.src.rpm - test-pkgB-2-1.1.noarch.rpm - test-pkgB-2-1.1.src.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgA-3-1.src.rpm + test-pkgB-2-1.noarch.rpm + test-pkgB-2-1.src.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log @@ -78,15 +77,15 @@ Scenario: Run `osc getbinaries --debuginfo` from a project checkou When I execute osc with args "getbinaries standard x86_64 --debuginfo" Then directory tree in "{context.osc.temp}/openSUSE:Factory/binaries/" is """ - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-debugsource-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-debuginfo-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgB-2-1.1.noarch.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-debuginfo-1-1.x86_64.rpm + multibuild-pkg-debugsource-1-1.x86_64.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor1-debuginfo-1-1.x86_64.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + multibuild-pkg-flavor2-debuginfo-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgB-2-1.noarch.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log diff --git a/behave/features/getbinaries-repo-pkgcheckout.feature b/behave/features/getbinaries-repo-pkgcheckout.feature index 8ed0e43e..1d129eba 100644 --- a/behave/features/getbinaries-repo-pkgcheckout.feature +++ b/behave/features/getbinaries-repo-pkgcheckout.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command from a project checkout @@ -14,8 +13,8 @@ Scenario: Run `osc getbinaries ` from a package checkout When I execute osc with args "getbinaries standard" Then directory listing of "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/binaries/" is """ - multibuild-pkg-1-1.1.i586.rpm - multibuild-pkg-1-1.1.x86_64.rpm + multibuild-pkg-1-1.i586.rpm + multibuild-pkg-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -26,8 +25,8 @@ Scenario: Run `osc getbinaries --multibuild-package=` from a pack When I execute osc with args "getbinaries standard --multibuild-package=flavor1" Then directory listing of "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/binaries/" is """ - multibuild-pkg-flavor1-1-1.1.i586.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm + multibuild-pkg-flavor1-1-1.i586.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm _buildenv _statistics rpmlint.log @@ -38,12 +37,12 @@ Scenario: Run `osc getbinaries --debuginfo` from a package checkout When I execute osc with args "getbinaries standard --debuginfo" Then directory listing of "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/binaries/" is """ - multibuild-pkg-1-1.1.i586.rpm - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-debuginfo-1-1.1.i586.rpm - multibuild-pkg-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-debugsource-1-1.1.i586.rpm - multibuild-pkg-debugsource-1-1.1.x86_64.rpm + multibuild-pkg-1-1.i586.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-debuginfo-1-1.i586.rpm + multibuild-pkg-debuginfo-1-1.x86_64.rpm + multibuild-pkg-debugsource-1-1.i586.rpm + multibuild-pkg-debugsource-1-1.x86_64.rpm _buildenv _statistics rpmlint.log diff --git a/behave/features/getbinaries-repo-prjcheckout.feature b/behave/features/getbinaries-repo-prjcheckout.feature index fb56025b..bcdd8ee5 100644 --- a/behave/features/getbinaries-repo-prjcheckout.feature +++ b/behave/features/getbinaries-repo-prjcheckout.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc getbinaries ` command from a project checkout @@ -13,14 +12,14 @@ Scenario: Run `osc getbinaries ` from a project checkout When I execute osc with args "getbinaries standard" Then directory tree in "{context.osc.temp}/openSUSE:Factory/binaries/" is """ - multibuild-pkg-1-1.1.i586.rpm - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-1-1.1.i586.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-1-1.1.i586.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgB-2-1.1.noarch.rpm + multibuild-pkg-1-1.i586.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-flavor1-1-1.i586.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor2-1-1.i586.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgB-2-1.noarch.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log @@ -49,19 +48,19 @@ Scenario: Run `osc getbinaries --sources` from a project checkout When I execute osc with args "getbinaries standard --sources" Then directory tree in "{context.osc.temp}/openSUSE:Factory/binaries/" is """ - multibuild-pkg-1-1.1.i586.rpm - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-flavor1-1-1.1.i586.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-1-1.1.src.rpm - multibuild-pkg-flavor2-1-1.1.i586.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgA-3-1.1.src.rpm - test-pkgB-2-1.1.noarch.rpm - test-pkgB-2-1.1.src.rpm + multibuild-pkg-1-1.i586.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-flavor1-1-1.i586.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-1-1.src.rpm + multibuild-pkg-flavor2-1-1.i586.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgA-3-1.src.rpm + test-pkgB-2-1.noarch.rpm + test-pkgB-2-1.src.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log @@ -84,22 +83,22 @@ Scenario: Run `osc getbinaries --debuginfo` from a project checkout When I execute osc with args "getbinaries standard --debuginfo" Then directory tree in "{context.osc.temp}/openSUSE:Factory/binaries/" is """ - multibuild-pkg-1-1.1.i586.rpm - multibuild-pkg-1-1.1.x86_64.rpm - multibuild-pkg-debuginfo-1-1.1.i586.rpm - multibuild-pkg-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-debugsource-1-1.1.i586.rpm - multibuild-pkg-debugsource-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-1-1.1.i586.rpm - multibuild-pkg-flavor1-1-1.1.x86_64.rpm - multibuild-pkg-flavor1-debuginfo-1-1.1.i586.rpm - multibuild-pkg-flavor1-debuginfo-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-1-1.1.i586.rpm - multibuild-pkg-flavor2-1-1.1.x86_64.rpm - multibuild-pkg-flavor2-debuginfo-1-1.1.i586.rpm - multibuild-pkg-flavor2-debuginfo-1-1.1.x86_64.rpm - test-pkgA-3-1.1.noarch.rpm - test-pkgB-2-1.1.noarch.rpm + multibuild-pkg-1-1.i586.rpm + multibuild-pkg-1-1.x86_64.rpm + multibuild-pkg-debuginfo-1-1.i586.rpm + multibuild-pkg-debuginfo-1-1.x86_64.rpm + multibuild-pkg-debugsource-1-1.i586.rpm + multibuild-pkg-debugsource-1-1.x86_64.rpm + multibuild-pkg-flavor1-1-1.i586.rpm + multibuild-pkg-flavor1-1-1.x86_64.rpm + multibuild-pkg-flavor1-debuginfo-1-1.i586.rpm + multibuild-pkg-flavor1-debuginfo-1-1.x86_64.rpm + multibuild-pkg-flavor2-1-1.i586.rpm + multibuild-pkg-flavor2-1-1.x86_64.rpm + multibuild-pkg-flavor2-debuginfo-1-1.i586.rpm + multibuild-pkg-flavor2-debuginfo-1-1.x86_64.rpm + test-pkgA-3-1.noarch.rpm + test-pkgB-2-1.noarch.rpm multibuild-pkg/_buildenv multibuild-pkg/_statistics multibuild-pkg/rpmlint.log diff --git a/behave/features/list.feature b/behave/features/list.feature index e0dc8453..5c247240 100644 --- a/behave/features/list.feature +++ b/behave/features/list.feature @@ -1,4 +1,3 @@ -@no-snapshot Feature: `osc list` command @@ -6,9 +5,11 @@ Scenario: Run `osc list` with no arguments to display all projects When I execute osc with args "list" Then stdout is """ + devel home:Admin openSUSE.org openSUSE:Factory + release """ diff --git a/behave/features/steps/kanku.py b/behave/features/steps/kanku.py deleted file mode 100644 index 98328838..00000000 --- a/behave/features/steps/kanku.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/python3 - - -import os -import re -import subprocess - -import behave -from ruamel.yaml import YAML - - -class Kanku: - def __init__(self, context, kankufile): - self.kankufile = kankufile - self.kankudir = os.path.dirname(self.kankufile) - self.domain_name = self._get_domain_name() - self.ip = self._get_ip() - - def _get_domain_name(self): - """ - Get domain name directly from KankuFile yaml - """ - yaml = YAML(typ='safe') - doc = yaml.load(open(self.kankufile, "r")) - return doc["domain_name"] - - def _run_kanku(self, args): - cmd = ["kanku"] + args - env = os.environ.copy() - env["KANKU_CONFIG"] = self.kankufile - proc = subprocess.Popen( - cmd, - cwd=self.kankudir, - env=env, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - encoding="utf-8" - ) - return proc - - def _get_ip(self): - """ - Get IP from calling `kanku ip` - """ - proc = self._run_kanku(["ip"]) - stdout, stderr = proc.communicate() - match = re.search(r"IP Address: ([\d\.]+)", stderr) - return match.group(1) - - def create_snapshot(self): - # unmount /tmp/kanku so we are able to create a snapshot of the VM - self.run_command("umount /tmp/kanku") - proc = self._run_kanku(["snapshot", "--create", "--name", "current"]) - proc.communicate() - - def revert_to_snapshot(self): - proc = self._run_kanku(["snapshot", "--revert", "--name", "current"]) - proc.communicate() - - def delete_snapshot(self): - proc = self._run_kanku(["snapshot", "--remove", "--name", "current"]) - proc.communicate() - - def run_command(self, ssh_cmd, user="root"): - proc = self._run_kanku(["ssh", "-u", user, "--execute", ssh_cmd]) - proc.wait() - - -@behave.step("I create VM snapshot") -def func(context, args): - context.kanku.create_snapshot(sudo=True) - - -@behave.step("I revert to VM snapshot") -def func(context, args): - context.kanku.revert_to_snapshot(sudo=True) diff --git a/behave/features/steps/osc.py b/behave/features/steps/osc.py index f6b5e4e1..95972b99 100644 --- a/behave/features/steps/osc.py +++ b/behave/features/steps/osc.py @@ -10,21 +10,12 @@ from steps.common import run_in_context class Osc: def __init__(self, context): - self.temp = tempfile.mkdtemp(prefix="osc_behave_") + if not hasattr(context, "podman"): + raise RuntimeError("context doesn't have 'podman' object set") - if not hasattr(context, "kanku"): - raise RuntimeError("context doesn't have kanku object set") - - self.oscrc = os.path.join(self.temp, "oscrc") - with open(self.oscrc, "w") as f: - f.write("[general]\n") - f.write("\n") - f.write(f"[https://{context.kanku.ip}]\n") - f.write("user=Admin\n") - f.write("pass=opensuse\n") - f.write("credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager\n") - f.write("sslcertck=0\n") - f.write("trusted_prj=openSUSE.org:openSUSE:Tumbleweed\n") + self.context = context + self.temp = None + self.clear() def __del__(self): try: @@ -32,18 +23,35 @@ class Osc: except Exception: pass - def get_cmd(self, context): - osc_cmd = context.config.userdata.get("osc", "osc") + def clear(self): + if self.temp: + shutil.rmtree(self.temp) + self.temp = tempfile.mkdtemp(prefix="osc_behave_") + self.oscrc = os.path.join(self.temp, "oscrc") + with open(self.oscrc, "w") as f: + f.write("[general]\n") + f.write("\n") + f.write(f"[https://localhost:{self.context.podman.port}]\n") + f.write("user=Admin\n") + f.write("pass=opensuse\n") + f.write("credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager\n") + f.write("sslcertck=0\n") + f.write("http_headers =\n") + # avoid the initial 401 response by setting auth to Admin:opensuse directly + f.write(" authorization: Basic QWRtaW46b3BlbnN1c2U=\n") + + def get_cmd(self): + osc_cmd = self.context.config.userdata.get("osc", "osc") cmd = [osc_cmd] cmd += ["--config", self.oscrc] - cmd += ["-A", f"https://{context.kanku.ip}"] + cmd += ["-A", f"https://localhost:{self.context.podman.port}"] return cmd @behave.step("I execute osc with args \"{args}\"") def step_impl(context, args): args = args.format(context=context) - cmd = context.osc.get_cmd(context) + [args] + cmd = context.osc.get_cmd() + [args] cmd = " ".join(cmd) run_in_context(context, cmd, can_fail=True) @@ -51,7 +59,7 @@ def step_impl(context, args): @behave.step('I wait for osc results for "{project}" "{package}"') def step_impl(context, project, package): args = f"results {project} {package} --csv --format='%(code)s,%(dirty)s'" - cmd = context.osc.get_cmd(context) + [args] + cmd = context.osc.get_cmd() + [args] cmd = " ".join(cmd) while True: diff --git a/behave/features/steps/podman.py b/behave/features/steps/podman.py new file mode 100644 index 00000000..4bafaa6a --- /dev/null +++ b/behave/features/steps/podman.py @@ -0,0 +1,68 @@ +import subprocess + + +class Podman: + def __init__(self): + self.container_id = None + self.run() + self.wait_on_systemd() + self.port = self.get_port() + + def __del__(self): + try: + self.kill() + except Exception: + pass + + def _run(self, args, check=True): + cmd = ["podman"] + args + proc = subprocess.run( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + encoding="utf-8", + check=check, + ) + return proc + + def run(self): + args = [ + "run", + "--name", "obs-server-behave", + "--hostname", "obs-server-behave", + "--replace", + "--rm", + "--detach", + "--interactive", + "--tty", + "-p", "443", + "obs-server" + ] + proc = self._run(args) + lines = proc.stdout.strip().splitlines() + self.container_id = lines[-1] + + def kill(self): + if not self.container_id: + return + args = ["kill", self.container_id] + self._run(args) + self.container_id = None + + def wait_on_systemd(self): + args = [ + "exec", + self.container_id, + "/usr/bin/systemctl", "is-system-running", "--wait" + ] + self._run(args, check=False) + + def get_port(self): + args = ["port", self.container_id] + proc = self._run(args) + lines = proc.stdout.strip().splitlines() + for line in lines: + if line.startswith("443/tcp"): + # return from: "443/tcp -> 0.0.0.0:" + return line.split(":")[-1] + return None diff --git a/behave/fixtures/pac/multibuild-pkg-1.spec b/behave/fixtures/pac/multibuild-pkg-1.spec index 89c75c47..6238316c 100644 --- a/behave/fixtures/pac/multibuild-pkg-1.spec +++ b/behave/fixtures/pac/multibuild-pkg-1.spec @@ -1,4 +1,6 @@ +%if %undefined flavor %define flavor @BUILD_FLAVOR@%{nil} +%endif # create own debug packages, because the auto-generated would get removed due to being empty %undefine _debuginfo_subpackages @@ -6,7 +8,7 @@ Name: multibuild-pkg Version: 1 -Release: 0 +Release: 1 License: GPL-2.0 Summary: Test package URL: https://example.com/test-package/ diff --git a/behave/fixtures/pac/test-pkgA-1.spec b/behave/fixtures/pac/test-pkgA-1.spec index aeb4a71c..8dbaa59e 100644 --- a/behave/fixtures/pac/test-pkgA-1.spec +++ b/behave/fixtures/pac/test-pkgA-1.spec @@ -1,6 +1,6 @@ Name: test-pkgA Version: 1 -Release: 0 +Release: 1 License: GPL-2.0 Summary: Test package URL: https://example.com/test-package/ diff --git a/behave/fixtures/pac/test-pkgA-2.spec b/behave/fixtures/pac/test-pkgA-2.spec index 7652fccc..7f033a2e 100644 --- a/behave/fixtures/pac/test-pkgA-2.spec +++ b/behave/fixtures/pac/test-pkgA-2.spec @@ -1,6 +1,6 @@ Name: test-pkgA Version: 2 -Release: 0 +Release: 1 License: GPL-2.0 Summary: Test package URL: https://example.com/test-package/ diff --git a/behave/fixtures/pac/test-pkgA-3.spec b/behave/fixtures/pac/test-pkgA-3.spec index 2d0f1152..0fc6a5cb 100644 --- a/behave/fixtures/pac/test-pkgA-3.spec +++ b/behave/fixtures/pac/test-pkgA-3.spec @@ -1,6 +1,6 @@ Name: test-pkgA Version: 3 -Release: 0 +Release: 1 License: GPL-2.0 Summary: Test package URL: https://example.com/test-package/ diff --git a/behave/fixtures/pac/test-pkgB-1.spec b/behave/fixtures/pac/test-pkgB-1.spec index b5c64e67..267a490d 100644 --- a/behave/fixtures/pac/test-pkgB-1.spec +++ b/behave/fixtures/pac/test-pkgB-1.spec @@ -1,6 +1,6 @@ Name: test-pkgB Version: 1 -Release: 0 +Release: 1 License: GPL-2.0 Summary: Test package URL: https://example.com/test-package/ diff --git a/behave/fixtures/pac/test-pkgB-2.spec b/behave/fixtures/pac/test-pkgB-2.spec index 51cfb015..f86ba973 100644 --- a/behave/fixtures/pac/test-pkgB-2.spec +++ b/behave/fixtures/pac/test-pkgB-2.spec @@ -1,6 +1,6 @@ Name: test-pkgB Version: 2 -Release: 0 +Release: 1 License: GPL-2.0 Summary: Test package URL: https://example.com/test-package/ diff --git a/behave/fixtures/prj/devel.xml b/behave/fixtures/prj/devel.xml new file mode 100644 index 00000000..9b0a93f1 --- /dev/null +++ b/behave/fixtures/prj/devel.xml @@ -0,0 +1,26 @@ + + + Devel project + + + + + + + + + + + + + + + + + + + x86_64 + i586 + + + diff --git a/behave/fixtures/prj/home_Admin.xml b/behave/fixtures/prj/home_Admin.xml index 3782b5df..dc265447 100644 --- a/behave/fixtures/prj/home_Admin.xml +++ b/behave/fixtures/prj/home_Admin.xml @@ -5,6 +5,18 @@ + + + + + + + + + + + + x86_64 diff --git a/behave/fixtures/prj/openSUSE_Factory.xml b/behave/fixtures/prj/openSUSE_Factory.xml index cf20d7ec..2a7daaa9 100644 --- a/behave/fixtures/prj/openSUSE_Factory.xml +++ b/behave/fixtures/prj/openSUSE_Factory.xml @@ -5,6 +5,18 @@ + + + + + + + + + + + + x86_64 diff --git a/behave/fixtures/prj/release.xml b/behave/fixtures/prj/release.xml new file mode 100644 index 00000000..62f06d4a --- /dev/null +++ b/behave/fixtures/prj/release.xml @@ -0,0 +1,28 @@ + + + Release project + + + + + + + + + + + + + + + + + + + x86_64 + i586 + + + diff --git a/behave/obs-setup/environment.py b/behave/obs-setup/environment.py deleted file mode 100644 index f8cd63f2..00000000 --- a/behave/obs-setup/environment.py +++ /dev/null @@ -1,20 +0,0 @@ -import os - -from steps import osc - - -# doesn't do anything, just points osc to localhost -class FakeKanku: - ip = "localhost" - - -def before_all(context): - context.fixtures = os.path.join(os.path.dirname(__file__), "..", "fixtures") - context.kanku = FakeKanku() - context.osc = osc.Osc(context) - - -def after_all(context): - del context.osc - del context.kanku - del context.fixtures diff --git a/behave/obs-setup/obs-setup.feature b/behave/obs-setup/obs-setup.feature deleted file mode 100644 index 4f45a02c..00000000 --- a/behave/obs-setup/obs-setup.feature +++ /dev/null @@ -1,113 +0,0 @@ -# This is a special feature that should be used only in kanku VM to create initial OBS configuration. -# The scenarios follow each other and there is NO CLEANUP between them. - - -Feature: Setup OBS. - - -# Using interconnect feature is a must. -# We tried to configure projects from scratch (with download-on-demand repos), -# but there are simply too many settings that must be configured properly to make it work. -# -Scenario: Create openSUSE.org project that interconnects to another OBS instance - Given I execute osc with args "api -X PUT '/source/openSUSE.org/_meta' --file {context.fixtures}/prj/openSUSE.org.xml" - When I execute osc with args "list" - Then stdout is - """ - openSUSE.org - """ - - -Scenario: Create openSUSE:Factory project - Given I execute osc with args "api -X PUT '/source/openSUSE:Factory/_meta' --file {context.fixtures}/prj/openSUSE_Factory.xml" - When I execute osc with args "list" - Then stdout is - """ - openSUSE.org - openSUSE:Factory - """ - - -Scenario: Create home:Admin project - Given I execute osc with args "api -X PUT '/source/home:Admin/_meta' --file {context.fixtures}/prj/home_Admin.xml" - When I execute osc with args "list" - Then stdout is - """ - home:Admin - openSUSE.org - openSUSE:Factory - """ - - -Scenario: Create and build package 'test-pkgA' in 'openSUSE:Factory' project - # checkout project - Given I set working directory to "{context.osc.temp}" - When I execute osc with args "checkout openSUSE:Factory" - Then directory "{context.osc.temp}/openSUSE:Factory" exists - And directory "{context.osc.temp}/openSUSE:Factory/.osc" exists - - # create package - Given I set working directory to "{context.osc.temp}/openSUSE:Factory" - When I execute osc with args "mkpac test-pkgA" - Then directory "{context.osc.temp}/openSUSE:Factory/test-pkgA" exists - And directory "{context.osc.temp}/openSUSE:Factory/test-pkgA/.osc" exists - - # add and commit new package content - Given I set working directory to "{context.osc.temp}/openSUSE:Factory/test-pkgA" - # revision 1 - When I copy file "{context.fixtures}/pac/test-pkgA-1.spec" to "{context.osc.temp}/openSUSE:Factory/test-pkgA/test-pkgA.spec" - And I copy file "{context.fixtures}/pac/test-pkgA-1.changes" to "{context.osc.temp}/openSUSE:Factory/test-pkgA/test-pkgA.changes" - And I execute osc with args "add test-pkgA.spec test-pkgA.changes" - And I execute osc with args "commit -m 'Initial commit'" - # revision 2 - And I copy file "{context.fixtures}/pac/test-pkgA-2.spec" to "{context.osc.temp}/openSUSE:Factory/test-pkgA/test-pkgA.spec" - And I copy file "{context.fixtures}/pac/test-pkgA-2.changes" to "{context.osc.temp}/openSUSE:Factory/test-pkgA/test-pkgA.changes" - And I execute osc with args "commit -m 'Version 2'" - # revision 3 - And I copy file "{context.fixtures}/pac/test-pkgA-3.spec" to "{context.osc.temp}/openSUSE:Factory/test-pkgA/test-pkgA.spec" - And I copy file "{context.fixtures}/pac/test-pkgA-3.changes" to "{context.osc.temp}/openSUSE:Factory/test-pkgA/test-pkgA.changes" - And I execute osc with args "commit -m 'Version 3'" - Then I wait for osc results for "openSUSE:Factory" "test-pkgA" - - -Scenario: Create and build package 'test-pkgB' in 'openSUSE:Factory' project - # project checkout exists in temp already, no need to run checkout again - - # create package - Given I set working directory to "{context.osc.temp}/openSUSE:Factory" - When I execute osc with args "mkpac test-pkgB" - Then directory "{context.osc.temp}/openSUSE:Factory/test-pkgB" exists - And directory "{context.osc.temp}/openSUSE:Factory/test-pkgB/.osc" exists - - # add and commit new package content - Given I set working directory to "{context.osc.temp}/openSUSE:Factory/test-pkgB" - # revision 1 - When I copy file "{context.fixtures}/pac/test-pkgB-1.spec" to "{context.osc.temp}/openSUSE:Factory/test-pkgB/test-pkgB.spec" - And I copy file "{context.fixtures}/pac/test-pkgB-1.changes" to "{context.osc.temp}/openSUSE:Factory/test-pkgB/test-pkgB.changes" - And I execute osc with args "add test-pkgB.spec test-pkgB.changes" - And I execute osc with args "commit -m 'Initial commit'" - # revision 2 - And I copy file "{context.fixtures}/pac/test-pkgB-2.spec" to "{context.osc.temp}/openSUSE:Factory/test-pkgB/test-pkgB.spec" - And I copy file "{context.fixtures}/pac/test-pkgB-2.changes" to "{context.osc.temp}/openSUSE:Factory/test-pkgB/test-pkgB.changes" - And I execute osc with args "commit -m 'Version 2'" - Then I wait for osc results for "openSUSE:Factory" "test-pkgB" - - -Scenario: Create and build package 'multibuild-pkg' in 'openSUSE:Factory' project - # project checkout exists in temp already, no need to run checkout again - - # create package - Given I set working directory to "{context.osc.temp}/openSUSE:Factory" - When I execute osc with args "mkpac multibuild-pkg" - Then directory "{context.osc.temp}/openSUSE:Factory/multibuild-pkg" exists - And directory "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/.osc" exists - - # add and commit new package content - Given I set working directory to "{context.osc.temp}/openSUSE:Factory/multibuild-pkg" - # revision 1 - When I copy file "{context.fixtures}/pac/multibuild-pkg-1.spec" to "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/multibuild-pkg.spec" - And I copy file "{context.fixtures}/pac/multibuild-pkg-1.changes" to "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/multibuild-pkg.changes" - And I copy file "{context.fixtures}/pac/multibuild-pkg-1._multibuild" to "{context.osc.temp}/openSUSE:Factory/multibuild-pkg/_multibuild" - And I execute osc with args "add multibuild-pkg.spec multibuild-pkg.changes _multibuild" - And I execute osc with args "commit -m 'Initial commit'" - Then I wait for osc results for "openSUSE:Factory" "multibuild-pkg" diff --git a/behave/obs-setup/steps b/behave/obs-setup/steps deleted file mode 120000 index 3a547014..00000000 --- a/behave/obs-setup/steps +++ /dev/null @@ -1 +0,0 @@ -../features/steps \ No newline at end of file diff --git a/behave/requirements.spec b/behave/requirements.spec deleted file mode 100644 index 5a09d31e..00000000 --- a/behave/requirements.spec +++ /dev/null @@ -1,46 +0,0 @@ -# This package is not meant to be built and installed. -# It is for installing the test suite dependencies. -# -# Please follow the instructions in README.md. - - -# packages needed to manage virtual machines -%bcond_without host_only_packages - -# minimal required behave version -%define behave_version 1.2.6 - - -Name: osc-behave-requirements -Version: 1 -Release: 0 -Summary: Requirements for the OSC Behave tests -License: GPLv2 - - -# don't install kanku inside a kanku VM -%if %{with host_only_packages} -BuildRequires: kanku -%endif - -# osc -BuildRequires: osc - -# behave -BuildRequires: (python3dist(behave) >= %{behave_version} or python3-behave >= %{behave_version}) - -# needed by steps/kanku.py -BuildRequires: (python3dist(ruamel.yaml) or python3-ruamel.yaml) - -# fixes: ModuleNotFoundError: No module named 'pkg_resources' -BuildRequires: (python3dist(setuptools) or python3-setuptools) - - -%description -%{summary} - - -%files - - -%changelog diff --git a/behave/requirements.txt b/behave/requirements.txt deleted file mode 100644 index 620958e6..00000000 --- a/behave/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -behave >= 1.2.6