#572 [beaker-tests-sanity] add simple post-release check
Merged 5 years ago by praiskup. Opened 5 years ago by frostyx.
copr/ frostyx/copr beaker-test-production  into  master

@@ -0,0 +1,64 @@ 

+ #!/bin/bash

+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest-production.sh of /tools/copr/Sanity/copr-cli-basic-operations

+ #   Description: A simple post-release test to check whether Copr works

+ #   Author: Jakub Kadlcik <jkadlcik@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2019 Red Hat, Inc.

+ #

+ #   This program is free software: you can redistribute it and/or

+ #   modify it under the terms of the GNU General Public License as

+ #   published by the Free Software Foundation, either version 2 of

+ #   the License, or (at your option) any later version.

+ #

+ #   This program is distributed in the hope that it will be

+ #   useful, but WITHOUT ANY WARRANTY; without even the implied

+ #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR

+ #   PURPOSE.  See the GNU General Public License for more details.

+ #

+ #   You should have received a copy of the GNU General Public License

+ #   along with this program. If not, see http://www.gnu.org/licenses/.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ # Include Beaker environment

+ . /usr/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ # Load config settings

+ HERE=$(dirname "$(realpath "$0")")

+ source "$HERE/config"

+ 

+ COPRCONF="/root/.config/copr-production"

+ 

+ if [ ! -f $COPRCONF ]; then

+     echo "Error: File $COPRCONF not found!"

+     echo "If you want to run this test against the production instance,"

+     echo "you must fetch and store your production API token manually."

+     echo "For obvious reasons any production config cannot be stored in git."

+     exit 1

+ fi

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlRun "copr --config $COPRCONF create ${NAME_PREFIX}PostReleaseTest --unlisted-on-hp on --chroot $CHROOT"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         # Please do not enhance this file with many other tests.

+         # The whole purpose of this file is to have a simple post-release

+         # test instead of manually submitting a build.

+         # Everything else should be tested only on dev instance.

+         rlRun "copr --config $COPRCONF buildscm --clone-url https://src.fedoraproject.org/rpms/copr-cli.git ${NAME_PREFIX}PostReleaseTest"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "copr-cli --config $COPRCONF delete ${NAME_PREFIX}PostReleaseTest"

+     rlPhaseEnd

+ 

+ rlJournalPrintText

+ rlJournalEnd

file modified
+6 -1
@@ -197,7 +197,12 @@ 

  Test production machine

  -----------------------

  

- Just run some build and check if it succeeds.

+ Run post-release beaker test::

+ 

+     [root@test-env ~]$ cd /root/copr/beaker-tests/Sanity/copr-cli-basic-operations/

+     [root@test-env ~]$ ./runtest-production.sh

+ 

+ or just run some build and check if it succeeds.

  

  Submit Bodhi updates

  --------------------

The "How to release Copr" document suggest to run some build
and check if it succeeds, to test the post-release production instance.

My problem with this is that I have to think what to build and where.
Personally, I would rather run just another test script.

Because the test is supposed to be run from beaker-tests/DockerTestEnv/ container and we use root there. See, how it is suggested to run the test in doc/how_to_release_copr.rst

Note that running anything in docker container as a root is considered to be insecure (as anything with Docker environment in copr case is). But it's not new thing for DockerTestEnv... I'm +1 to have this "automatized" (after fixing C&P). Btw., it would be awesome to move to Podman&friends ... and to not require root anywhere (yes, because beakerlib ... but for the added test it is disputable whether we benefit from the beakerlib wrapped, because it basically means that we can not execute it on our boxes - and here I'd really love to).

rebased onto ec159e357a971121fd3077ff5149b395d27ade80

5 years ago

I've updated the header and used copr-cli as a test package.

rebased onto 44954c4

5 years ago

Pull-Request has been merged by praiskup

5 years ago