Commit Graph

10 Commits

Author SHA1 Message Date
Alexander Todorov
8c409c8263 Use a temporary shared dir when testing
otherwise composer-cli is unable to glob() the kickstart
files and we're left without supported compose types. Seen
during AWS testing for example.

Helps with running some of the tests via sudo b/c this is
what Jenkins requires.

(cherry picked from commit b88466fd74)
2019-05-03 16:43:41 -07:00
Alexander Todorov
9c17c0cc6c Copy blueprints used for testing to temporary directory
If trying to execute test_cli.sh inside a git checkout
we are going to get the following exception:

Traceback (most recent call last):
  File "./src/sbin/lorax-composer", line 251, in <module>
    repo = open_or_create_repo(server.config["REPO_DIR"])
  File "/home/jenkins/lorax/src/pylorax/api/recipes.py", line 306, in open_or_create_repo
gi.repository.GLib.Error: ggit-error: failed to stat '/home/jenkins/lorax/tests/pylorax/blueprints': Permission denied (-1)
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python3.7/multiprocessing/popen_fork.py", line 54, in _send_signal
    os.kill(self.pid, sig)

From what I can tell open_or_create_repo() is trying to initialize
a git repository inside the blueprints directory which fails when
we have an active git checkout.

This doesn't happen when we run the tests in Travis CI because
rsync excludes .git/ inside the Docker container.

(cherry picked from commit c9d706a382)
2019-05-03 16:43:35 -07:00
Alexander Todorov
178eb927d6 Add make targets for Jenkins
these targets help hooking up things in Jenkins and enable us to
perform build & deploy tests for cloud images.

NOTE: use sudo -E to preserve the environment
(cherry picked from commit 366ae55abe)
2019-05-03 16:43:28 -07:00
Alexander Todorov
2184cff59c Teach test_cli.sh to execute test scripts via arguments
this will be used to invoke scripts that build/push cloud images
without having to duplicate the setup/teardown/report parts!

(cherry picked from commit af2ae790ce)
2019-05-03 16:41:00 -07:00
Alexander Todorov
019aa20d9f Disable execution of new tests which need Docker privileged mode
(cherry picked from commit 7d2b9d2d30)
2019-05-03 16:36:44 -07:00
Alexander Todorov
7c38d74c00 New tests: build ext4-filesystem and partitioned-disk composes
for the moment we just make sure these two can be built without
visible errors.

(cherry picked from commit 2eb62014db)
2019-05-03 16:36:38 -07:00
Brian C. Lane
3499426b2d Change make_dnf_dirs to be run as root
It needs to be root in order to set the ownership and permissions on the
directories that are under /var/lib/lorax/composer/

Refactor the directory creation into a utility function, and use a umask
of 0o006 to ensure that the parent directories created do not have o+rw
set on them (makedirs behavior is different between Python 3.6 and 3.7
so umask of 0 doesn't work consistently).
2018-10-10 14:25:38 -07:00
Brian C. Lane
b35fe9d32a Add beakerlib to Dockerfile.test
Also kill the lorax-composer process and remove /run/weldr/api.socket
so that when this is run with podman you don't get an error about
attempting to tar up the socket.
2018-10-05 09:09:10 -07:00
Alexander Todorov
79422eb78b New cli test covering basic compose commands
- need to specify --sharedir so lorax-composer can find its
  kickstart files

- each test script writes results into a separate directory to
  avoid a passing test overwriting the results from a failing one.
  To avoid reporting failures in case of previously failing tests
  (e.g. during development) remove the temporary directories holding
  tets results before execution!
2018-10-05 09:09:10 -07:00
Alexander Todorov
e2e73973dc Execute bash tests for composer-cli
these are built on top of beakerlib and we use its internal
protocol to figure out the result without relying on the full
test runner that is tipically used inside of a RHEL environment!

Includes a disabled test snippet for Issue #460
2018-10-05 09:09:10 -07:00