Commit graph

66 commits

Author SHA1 Message Date
Juanje Ojeda
b27795a03e test/system: Refactor tests using bats-support and bats-assert
The bats-support[0] and bats-assert[1] libraries extend the
capabilities of bats[2]. Mainly, bats-assert is very useful for clean
checking of values/outputs/return codes.

Apart from updating the cases to use the libraries, the test cases have
been restructured in a way that they don't depend on each other anymore.
This required major changes in the helpers.bats file.

Overall, the tests are cleaner to read and easier to extend due to the
test cases being independent.

Some slight changes were made to the test cases themselves. Should not
alter their final behaviour.

There will be a follow up commit that will take care of downloading of
the tested images locally and caching them using Skopeo to speedup the
tests and try to resolve network problems when pulling the images that
we experienced in the past.

[0] https://github.com/bats-core/bats-support
[1] https://github.com/bats-core/bats-assert
[2] https://github.com/bats-core/bats-core
2021-02-12 14:02:08 +01:00
Debarshi Ray
a05830893a playbooks: Don't use a separate file to pull the images
The Ansible playbooks are small enough as they are. Splitting things
across too many files makes it harder to remember which file does what.

https://github.com/containers/toolbox/pull/653
2020-12-21 16:41:17 +01:00
Juanje Ojeda
cf256870ce playbooks: Improve how 'systemd-tmpfiles --create' is invoked
The most important bit is the use of the 'creates' parameter of the
'command' module [1] because it conditionalizes the invocation of
'systemd-tmpfiles' on the presence of /run/media and self-documents its
purpose.

[1] https://docs.ansible.com/ansible/2.4/command_module.html

https://github.com/containers/toolbox/pull/652
2020-12-21 15:01:38 +01:00
Debarshi Ray
0af82ab339 playbooks/fedora-33: Fix the image URLs by adding the version suffix
The system tests for Fedora 33 were failing:
  not ok 21 Remove all images (2 should be present; --force should not
    be necessary)
  # (from function `is' in file test/system/helpers.bash, line 287,
  #  in test file test/system/302-rmi.bats, line 7)
  #   `is "$output" "" "The output should be empty"' failed
  # $ /usr/local/bin/toolbox rmi --all
  # Error: image
    3ac100502d2123aff1cf6314760c7a89c55108b8de6ea3c10ddc79a1479f0fca
    has dependent children
  # Error: image
    4a6adf1f2a96adf5ea0c02b61f9fa574306f77fc522f39c2ce6bb164daead882
    has dependent children
  # #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  # #|     FAIL: The output should be empty
  # #| expected: '[no output]'
  # #|   actual: 'Error: image
    3ac100502d2123aff1cf6314760c7a89c55108b8de6ea3c10ddc79a1479f0fca
    has dependent children'
  # #|         > 'Error: image
    4a6adf1f2a96adf5ea0c02b61f9fa574306f77fc522f39c2ce6bb164daead882
    has dependent children'
  # #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fallout from ff4e4905da

https://github.com/containers/toolbox/pull/642
2020-12-02 18:45:01 +01:00
Ondřej Míchal
ecc796246b playbooks: Bump fedora-toolbox image to f34 for Rawhide 2020-10-08 15:07:42 +02:00
Ondřej Míchal
ff4e4905da zuul, playbooks: Enable system tests on Fedora 33
https://github.com/containers/toolbox/pull/550
2020-09-08 14:54:07 -04:00
Ondřej Míchal
8c971b381a playbooks, .zuul: Clarify naming and descriptions
Not all tests are the same and the ones we're currently running are
system tests. Also the mention of 'podman-stable' is not that important
because we're using the version in the 'stable' stream of Fedora
releases.

https://github.com/containers/toolbox/pull/508
2020-07-21 17:09:17 +02:00
Harry Míchal
cf1b74e1db .zuul, playbooks/fedora-32: Enable testing for Fedora 32
New release out, we need to run the tests there.

https://github.com/containers/toolbox/pull/507
2020-07-21 16:31:56 +02:00
Harry Míchal
5a651eae2f playbooks, test/system: Test the Go implementation and update tests
In the Go implementation, when the 'rm' and 'rmi' commands fail to
remove a container or image, they don't use a non-zero exit code.
There's currently no nice fix for this. So, the tests have been
adjusted as a temporary measure.

https://github.com/containers/toolbox/pull/507
2020-07-21 16:31:50 +02:00
Harry Míchal
9c5bc56bbd playbooks: Add Go to the list of build dependencies
Otherwise, the tests on Fedora 31 and Rawhide fail with:
  meson.build:8:0: ERROR: Program(s) ['go'] not found or not executable

https://github.com/containers/toolbox/pull/506
2020-07-21 16:04:40 +02:00
Harry Míchal
6bcd9fd0c4 .zuul, playbooks/fedora-30: Drop testing for Fedora 30
Fedora 30 reached it's End of Life on the 26th of May, 2020 [1]; and
Toolbox requires Go 1.13 which is not available in Fedora 30.

[1] https://fedoraproject.org/wiki/End_of_life

https://github.com/containers/toolbox/pull/495
2020-07-09 16:02:49 +02:00
Harry Míchal
493bc1ffd5 .zuul, playbooks/shellcheck: Use Go 1.13
Toolbox requires Go 1.13, while Fedora 30 only has Go 1.12.17.
Therefore the test environment needs to be upgraded to something more
recent.

Otherwise, the test fails with:
  note: module requires Go 1.13

The name of the go-md2man package changed in Fedora 31, and hence had
to be updated.

https://github.com/containers/toolbox/pull/442
2020-05-14 16:14:47 +02:00
Harry Míchal
c95aacc488 playbooks/shellcheck: Add Go to the list of build dependencies
Otherwise, the test fails with:
  meson.build:8:0: ERROR: Program(s) ['go'] not found or not executable

https://github.com/containers/toolbox/pull/441
2020-05-14 15:39:00 +02:00
Harry Míchal
2d18f295a7 test/system: Update pre-pulled image for Rawhide
Current Rawhide is actually version 33. So the appropriate image should
be pre-pulled.

Because of the old version of image being pulled, the tests were
failing.
2020-03-13 17:16:12 +01:00
Tristan Cacqueray
50683c9d9a playbooks: Reduce flakiness due to network errors when pulling images
This change adds a pre-run task to pull the fedora-toolbox images from
the registry to reduce the number of false positives caused by
'podman pull' failing to download them during the actual test.

Each section needs a separate playbook because they use different
versions of Fedora, and hence different default images.

https://github.com/containers/toolbox/pull/375
2020-02-18 14:00:01 +01:00
Tristan Cacqueray
a28177a7ab Enable Zuul
This adds several .yaml files that specify jobs (those in folder
playbooks) and one that serves as the main config (.zuul.yaml).

Tests and builds are currently executed on every change in PRs (ie.,
check and gating) and periodically (according to the documentation
this pipeline should be run at least once a day).

There are 4 tests in total:

1. 'ninja test' - does the same thing that Travis did
2. Fedora 30 - runs the system tests with current Podman and Toolbox
   in Fedora 30
3. Fedora 31 - the same but for Fedora 31
4. Fedora Rawhide - the same but for Fedora Rawhide

https://github.com/containers/toolbox/issues/68
2020-01-22 16:11:53 +01:00