Commit Graph

9 Commits

Author SHA1 Message Date
Ed Santiago 267f309911 Rename $TESTSDIR (the plural one), step 1 of 3
...refactor '--signature-policy .../policy.json' to $WITH_POLICY_JSON

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-26 09:11:05 -06:00
Ed Santiago 0662a4e364 BATS major cleanup: blobcache.bats: refactor
Split out into its own commit, because it's a big one
to review.

The same code was literally copy-pasted a bunch of times, with
the only difference being the use of $doomeddir vs $destdir in
a couple of spots. Refactor, and while we're at it refactor the
tests for expected matches and mismatches.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2029
Approved by: rhatdan
2019-12-17 18:16:45 +00:00
Ed Santiago dee4b68ef0 BATS major cleanup, part 1: log-level
PR #1935 removed the default --debug logging; so all run_buildah
calls now use the default (error). It is safe to remove unnecessary
instances of --log-level=error .

For ease of review, this commit was entirely machine-generated via:

    $ perl -pi -e 's/ --log-level=error / /' *.bats

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2029
Approved by: rhatdan
2019-12-17 18:16:45 +00:00
Sascha Grunert 567141716e Add `--log-level` command line option and deprecate `--debug`
The previous log-level implementation does not seem to work, which is
now fixed and aligns to other projects like podman and CRI-O. Therefore
the `--debug` flag has been deprecated and is now hidden.

Added documentation as well as integration tests.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #1811
Approved by: rhatdan
2019-08-29 12:49:11 +00:00
Nalin Dahyabhai 4bb6252823 Replace kubernetes/pause in tests with k8s.gcr.io/pause
Replace use of the kubernetes/pause image in tests with
k8s.gcr.io/pause, except for the case that expects that we'll get a
schema 1 image when we pull without specifying a tag, since the new
image is a schema 2 image.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1564
Approved by: vrothberg
2019-05-01 19:08:49 +00:00
Ed Santiago 6ecc6d6cb4 BATS tests - extensive but minor cleanup
This started off as bug fixes necessary to get BATS tests
actually working on RHEL8 (they weren't). It grew. I will
defend my actions in the first comment post.

Primary change: import some helpers from podman BATS tests,
most importantly 'run_buildah' and 'is'. The vast majority
of the changes you'll see here are of the form:

    - run buildah ...
    - [ $status = 0 ]
    - [ check $output ]
    + run_buildah ...            ! automatically checks status
    + is "$output" "..."

Also: chmod'ed some files -x. Necessary because rpmbuild tries
to be oh-so-clever about requirements, and when it sees an
executable file with a shebang line like '#!env bats' it
helpfully adds 'Requires: /usr/bin/bats' to the rpm, which
then fails to install because RHEL8 does not have bats.

Also: refactored duplicate code in a few places, by writing
and invoking module-specific helper functions.

Also: changed a handful of 'buildah's to run_buildah, in
order to get error checking and debug logging.

Also: added descriptive reasons to many "skip"s.

Also: selinux test: some tweakery to make it run on production
system (context is different if /usr/bin/buildah is chcon'ed
appropriately). I can't get this test to pass on Fedora from
a build dir, and I'm actually not convinced that this test
has ever passed, but let's see what CI shows.

Also: selinux test: skip broken test (#1465).

Also: version test: skip parts of it if running w/o sources.

Tests are now passing as root on RHEL8; rootless has numerous
failures which I don't believe are related to this PR.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #1472
Approved by: TomSweeneyRedHat
2019-04-06 16:25:42 +00:00
Nalin Dahyabhai f6a02585a6 build-using-dockerfile,commit: disable compression by default
When committing an image to local storage, compressing the new layers
only wastes time because they need to be decompressed again when being
written to local storage.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1274
Approved by: rhatdan
2019-01-11 13:41:19 +00:00
Valentin Rothberg d88807e4a6 blobcache.bats: adjust explicit push tests
Remove error-prone parts of the explicit push tests that push to a
directory without using the blob-cache.  The proneness relates directly
to the fact that the layers of pulled images (i.e., the busybox base
image) are compressed with another gzip library the blobs in Buildah's
cache, which now use pgzip.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-04 17:20:41 +01:00
Nalin Dahyabhai 01f9ae2d70 Test blob caching
Check that when we use blob caching, the blobs that we commit and push
which came from the base image are indeed the same as the ones from the
base image.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1149
Approved by: rhatdan
2018-12-04 18:53:15 +00:00