Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref 2020-12-21 11:19:56 -05:00
parent 7734b68d6a
commit c7963db369
34 changed files with 55 additions and 55 deletions

View File

@ -37,7 +37,7 @@ Once you have decided to contribute to Buildah by working on an issue, check our
backlog of [open issues](https://github.com/containers/buildah/issues) looking backlog of [open issues](https://github.com/containers/buildah/issues) looking
for any that do not have an "In Progress" label attached to it. Often issues for any that do not have an "In Progress" label attached to it. Often issues
will be assigned to someone, to be worked on at a later time. If you have the will be assigned to someone, to be worked on at a later time. If you have the
time to work on the issue now add yourself as an assignee, and set the time to work on the issue now, add yourself as an assignee, and set the
"In Progress" label if youre a member of the “Containers” GitHub organization. "In Progress" label if youre a member of the “Containers” GitHub organization.
If you can not set the label, just add a quick comment in the issue asking that If you can not set the label, just add a quick comment in the issue asking that
the “In Progress” label be set and a member will do so for you. the “In Progress” label be set and a member will do so for you.

View File

@ -449,7 +449,7 @@ func Tail(a []string) []string {
} }
// UsageTemplate returns the usage template for podman commands // UsageTemplate returns the usage template for podman commands
// This blocks the desplaying of the global options. The main podman // This blocks the displaying of the global options. The main podman
// command should not use this. // command should not use this.
func UsageTemplate() string { func UsageTemplate() string {
return `Usage:{{if .Runnable}} return `Usage:{{if .Runnable}}

View File

@ -45,7 +45,7 @@ func TestContainerTemplateOutputInvalidFormat(t *testing.T) {
} }
} }
func TestContainerTemplateOutputInexistenceField(t *testing.T) { func TestContainerTemplateOutputNonexistentField(t *testing.T) {
params := containerOutputParams{ params := containerOutputParams{
ContainerID: "e477836657bb", ContainerID: "e477836657bb",
Builder: " ", Builder: " ",
@ -58,7 +58,7 @@ func TestContainerTemplateOutputInexistenceField(t *testing.T) {
err := containerOutputUsingTemplate(formatString, params) err := containerOutputUsingTemplate(formatString, params)
if err == nil || !strings.Contains(err.Error(), "can't evaluate field ID") { if err == nil || !strings.Contains(err.Error(), "can't evaluate field ID") {
t.Fatalf("expected error inexistence field") t.Fatalf("expected error nonexistent field")
} }
} }

View File

@ -328,7 +328,7 @@ func TestParseFilterInvalidFilter(t *testing.T) {
} }
} }
func TestMatchesDangingTrue(t *testing.T) { func TestMatchesDanglingTrue(t *testing.T) {
if !matchesDangling("<none>", "true") { if !matchesDangling("<none>", "true") {
t.Error("matchesDangling() should return true with dangling=true and name=<none>") t.Error("matchesDangling() should return true with dangling=true and name=<none>")
} }
@ -338,7 +338,7 @@ func TestMatchesDangingTrue(t *testing.T) {
} }
} }
func TestMatchesDangingFalse(t *testing.T) { func TestMatchesDanglingFalse(t *testing.T) {
if matchesDangling("hello", "true") { if matchesDangling("hello", "true") {
t.Error("matchesDangling() should return false with dangling=true and name=hello") t.Error("matchesDangling() should return false with dangling=true and name=hello")
} }
@ -411,7 +411,7 @@ func TestMatchesBeforeImageFalse(t *testing.T) {
} }
} }
func TestMatchesSinceeImageTrue(t *testing.T) { func TestMatchesSinceImageTrue(t *testing.T) {
// Make sure the tests are running as root // Make sure the tests are running as root
failTestIfNotRoot(t) failTestIfNotRoot(t)

View File

@ -529,7 +529,7 @@ func (b *Builder) SetHistoryComment(comment string) {
} }
// StopSignal returns the signal which will be set in the container and in // StopSignal returns the signal which will be set in the container and in
// containers built using images buiilt from the container // containers built using images built from the container
func (b *Builder) StopSignal() string { func (b *Builder) StopSignal() string {
return b.Docker.Config.StopSignal return b.Docker.Config.StopSignal
} }

View File

@ -13,7 +13,7 @@
# #
FROM registry.fedoraproject.org/fedora:latest FROM registry.fedoraproject.org/fedora:latest
# Build a version: Copy tar file from bohdi to `/root/tmp` then run # Build a version: Copy tar file from bodhi to `/root/tmp` then run
# `podman build -t quay.io/stable:v1.14.3 -f ~/Containerfile.buildahstable .` # `podman build -t quay.io/stable:v1.14.3 -f ~/Containerfile.buildahstable .`
# Don't include container-selinux and remove directories # Don't include container-selinux and remove directories

View File

@ -242,7 +242,7 @@ in_podman() {
[[ -z "$envname" ]] || [[ -z "$envvalue" ]] || \ [[ -z "$envname" ]] || [[ -z "$envvalue" ]] || \
envargs="${envargs:+$envargs }-e $envname=$envvalue" envargs="${envargs:+$envargs }-e $envname=$envvalue"
done done
# Back in the days of testing under PAPR, containers were run with super-privledges. # Back in the days of testing under PAPR, containers were run with super-privileges.
# That behavior is preserved here with a few updates for modern podman behaviors. # That behavior is preserved here with a few updates for modern podman behaviors.
# The only other additions/changes are passthrough of CI-related env. vars ($envargs), # The only other additions/changes are passthrough of CI-related env. vars ($envargs),
# some path related updates, and mounting cgroups RW instead of the RO default. # some path related updates, and mounting cgroups RW instead of the RO default.

View File

@ -364,7 +364,7 @@ func cleanerReldirectory(candidate string) string {
return cleaned return cleaned
} }
// convertToRelSubirectory returns the path of directory, bound and relative to // convertToRelSubdirectory returns the path of directory, bound and relative to
// root, as a relative path, or an error if that path can't be computed or if // root, as a relative path, or an error if that path can't be computed or if
// the two directories are on different volumes // the two directories are on different volumes
func convertToRelSubdirectory(root, directory string) (relative string, err error) { func convertToRelSubdirectory(root, directory string) (relative string, err error) {

View File

@ -1,12 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# author : tsweeney (based on ipbabble's other demos) # author : tsweeney (based on ipbabble's other demos)
# Based on Alex Ellis blog (https://blog.alexellis.io/mutli-stage-docker-builds) # Based on Alex Ellis blog (https://blog.alexellis.io/multi-stage-docker-builds)
# Assumptions install buildah and podman # Assumptions install buildah and podman
# Set some of the variables below # Set some of the variables below
demoimg=mymultidemo demoimg=mymultidemo
quayuser=myquauuser quayuser=myquayuser
myname=MyName myname=MyName
distrorelease=30 distrorelease=30
pkgmgr=dnf # switch to yum if using yum pkgmgr=dnf # switch to yum if using yum

View File

@ -65,7 +65,7 @@ When the \fB\fC\-\-ignorefile\fR option is specified Buildah reads the
content to exclude files and directories from the source directory, when content to exclude files and directories from the source directory, when
copying content into the image. copying content into the image.
Users can specify a series of Unix shell globals in a inore file to Users can specify a series of Unix shell globals in a ignore file to
identify files/directories to exclude. identify files/directories to exclude.
Buildah supports a special wildcard string `**` which matches any number of Buildah supports a special wildcard string `**` which matches any number of

View File

@ -631,7 +631,7 @@ Only the current container can use a private volume.
`Overlay Volume Mounts` `Overlay Volume Mounts`
The `:O` flag tells Buildah to mount the directory from the host as a temporary storage using the Overlay file system. The `RUN` command containers are allowed to modify contents within the mountpoint and are stored in the container storage in a separate directory. In Ovelay FS terms the source directory will be the lower, and the container storage directory will be the upper. Modifications to the mount point are destroyed when the `RUN` command finishes executing, similar to a tmpfs mount point. The `:O` flag tells Buildah to mount the directory from the host as a temporary storage using the Overlay file system. The `RUN` command containers are allowed to modify contents within the mountpoint and are stored in the container storage in a separate directory. In Overlay FS terms the source directory will be the lower, and the container storage directory will be the upper. Modifications to the mount point are destroyed when the `RUN` command finishes executing, similar to a tmpfs mount point.
Any subsequent execution of `RUN` commands sees the original source directory content, any changes from previous RUN commands no longer exists. Any subsequent execution of `RUN` commands sees the original source directory content, any changes from previous RUN commands no longer exists.
@ -663,7 +663,7 @@ Use `df <source-dir>` to determine the source mount and then use
`findmnt -o TARGET,PROPAGATION <source-mount-dir>` to determine propagation `findmnt -o TARGET,PROPAGATION <source-mount-dir>` to determine propagation
properties of source mount, if `findmnt` utility is not available, the source mount point properties of source mount, if `findmnt` utility is not available, the source mount point
can be determined by looking at the mount entry in `/proc/self/mountinfo`. Look can be determined by looking at the mount entry in `/proc/self/mountinfo`. Look
at `optional fields` and see if any propagaion properties are specified. at `optional fields` and see if any propagation properties are specified.
`shared:X` means the mount is `shared`, `master:X` means the mount is `slave` and if `shared:X` means the mount is `shared`, `master:X` means the mount is `slave` and if
nothing is there that means the mount is `private`. <sup>[[1]](#Footnote1)</sup> nothing is there that means the mount is `private`. <sup>[[1]](#Footnote1)</sup>
@ -779,7 +779,7 @@ are stored while pulling and pushing images. Defaults to '/var/tmp'.
### `.dockerignore` ### `.dockerignore`
If the file .dockerignore exists in the context directory, `buildah copy` reads If the file .dockerignore exists in the context directory, `buildah copy` reads
its contents. Use `--ignorefile` flag to overide .dockerignore path location. its contents. Use `--ignorefile` flag to override .dockerignore path location.
Buildah uses the content to exclude files and directories from the context Buildah uses the content to exclude files and directories from the context
directory, when executing COPY and ADD directives in the directory, when executing COPY and ADD directives in the
Containerfile/Dockerfile Containerfile/Dockerfile

View File

@ -63,7 +63,7 @@ When the \fB\fC\-\-ignorefile\fR option is specified Buildah reads the
content to exclude files and directories from the source directory, when content to exclude files and directories from the source directory, when
copying content into the image. copying content into the image.
Users can specify a series of Unix shell globals in a inore file to Users can specify a series of Unix shell globals in a ignore file to
identify files/directories to exclude. identify files/directories to exclude.
Buildah supports a special wildcard string `**` which matches any number of Buildah supports a special wildcard string `**` which matches any number of

View File

@ -491,7 +491,7 @@ Only the current container can use a private volume.
`Overlay Volume Mounts` `Overlay Volume Mounts`
The `:O` flag tells Buildah to mount the directory from the host as a temporary storage using the Overlay file system. The `RUN` command containers are allowed to modify contents within the mountpoint and are stored in the container storage in a separate directory. In Ovelay FS terms the source directory will be the lower, and the container storage directory will be the upper. Modifications to the mount point are destroyed when the `RUN` command finishes executing, similar to a tmpfs mount point. The `:O` flag tells Buildah to mount the directory from the host as a temporary storage using the Overlay file system. The `RUN` command containers are allowed to modify contents within the mountpoint and are stored in the container storage in a separate directory. In Overlay FS terms the source directory will be the lower, and the container storage directory will be the upper. Modifications to the mount point are destroyed when the `RUN` command finishes executing, similar to a tmpfs mount point.
Any subsequent execution of `RUN` commands sees the original source directory content, any changes from previous RUN commands no longer exists. Any subsequent execution of `RUN` commands sees the original source directory content, any changes from previous RUN commands no longer exists.
@ -523,7 +523,7 @@ Use `df <source-dir>` to determine the source mount and then use
`findmnt -o TARGET,PROPAGATION <source-mount-dir>` to determine propagation `findmnt -o TARGET,PROPAGATION <source-mount-dir>` to determine propagation
properties of source mount, if `findmnt` utility is not available, the source mount point properties of source mount, if `findmnt` utility is not available, the source mount point
can be determined by looking at the mount entry in `/proc/self/mountinfo`. Look can be determined by looking at the mount entry in `/proc/self/mountinfo`. Look
at `optional fields` and see if any propagaion properties are specified. at `optional fields` and see if any propagation properties are specified.
`shared:X` means the mount is `shared`, `master:X` means the mount is `slave` and if `shared:X` means the mount is `shared`, `master:X` means the mount is `slave` and if
nothing is there that means the mount is `private`. <sup>[[1]](#Footnote1)</sup> nothing is there that means the mount is `private`. <sup>[[1]](#Footnote1)</sup>

View File

@ -14,7 +14,7 @@ All the cached credentials can be removed by setting the **all** flag.
**buildah [GLOBAL OPTIONS]** **buildah [GLOBAL OPTIONS]**
**bildah logout [GLOBAL OPTIONS]** **buildah logout [GLOBAL OPTIONS]**
**buildah logout [OPTIONS] REGISTRY [GLOBAL OPTIONS]** **buildah logout [OPTIONS] REGISTRY [GLOBAL OPTIONS]**
@ -43,7 +43,7 @@ Removed login credentials for docker.io
``` ```
``` ```
$ bildah logout --authfile authdir/myauths.json docker.io $ buildah logout --authfile authdir/myauths.json docker.io
Removed login credentials for docker.io Removed login credentials for docker.io
``` ```

View File

@ -248,7 +248,7 @@ Use `df <source-dir>` to determine the source mount and then use
`findmnt -o TARGET,PROPAGATION <source-mount-dir>` to determine propagation `findmnt -o TARGET,PROPAGATION <source-mount-dir>` to determine propagation
properties of source mount, if `findmnt` utility is not available, the source mount point properties of source mount, if `findmnt` utility is not available, the source mount point
can be determined by looking at the mount entry in `/proc/self/mountinfo`. Look can be determined by looking at the mount entry in `/proc/self/mountinfo`. Look
at `optional fields` and see if any propagaion properties are specified. at `optional fields` and see if any propagation properties are specified.
`shared:X` means the mount is `shared`, `master:X` means the mount is `slave` and if `shared:X` means the mount is `shared`, `master:X` means the mount is `slave` and if
nothing is there that means the mount is `private`. <sup>[[1]](#Footnote1)</sup> nothing is there that means the mount is `private`. <sup>[[1]](#Footnote1)</sup>

View File

@ -13,7 +13,7 @@ The Buildah project has been building some steam over the past several weeks, we
* Return exit code 1 when 'buildah rmi' fails. * Return exit code 1 when 'buildah rmi' fails.
* Improve lookups of a variety of image name formats. * Improve lookups of a variety of image name formats.
* Adds the --format and --filter parameters to the 'buildah containers' command. * Adds the --format and --filter parameters to the 'buildah containers' command.
* Adds the --prune,-p option to the 'buidah rmi' command allowing dangling images to be pruned. * Adds the --prune,-p option to the 'buildah rmi' command allowing dangling images to be pruned.
* Adds the --authfile parameter to the 'buildah commit' command. * Adds the --authfile parameter to the 'buildah commit' command.
* Fix the --runtime-flag for the 'buildah run' and 'buildah bud' commands when global flags are used. * Fix the --runtime-flag for the 'buildah run' and 'buildah bud' commands when global flags are used.
* The format parameter now overrides the quiet parameter for 'buildah images'. * The format parameter now overrides the quiet parameter for 'buildah images'.

View File

@ -276,4 +276,4 @@ Well done. You have learned a lot about Buildah using this short tutorial. Hopef
If you have any suggestions or issues please post them at the [Buildah Issues page](https://github.com/containers/buildah/issues). If you have any suggestions or issues please post them at the [Buildah Issues page](https://github.com/containers/buildah/issues).
For more information on Buildah and how you might contribute please visit the [Buildah home page on Github](https://github.com/containers/buildah). For more information on Buildah and how you might contribute please visit the [Buildah home page on GitHub](https://github.com/containers/buildah).

View File

@ -185,7 +185,7 @@ Well done. You have learned about Buildah's ONBUILD functionality using this sho
If you have any suggestions or issues please post them at the [Buildah Issues page](https://github.com/containers/buildah/issues). If you have any suggestions or issues please post them at the [Buildah Issues page](https://github.com/containers/buildah/issues).
For more information on Buildah and how you might contribute please visit the [Buildah home page on Github](https://github.com/containers/buildah). For more information on Buildah and how you might contribute please visit the [Buildah home page on GitHub](https://github.com/containers/buildah).
[GitHub]: https://github.com/containers/podman/ [GitHub]: https://github.com/containers/podman/
[image specification]: https://github.com/opencontainers/runtime-spec [image specification]: https://github.com/opencontainers/runtime-spec

View File

@ -259,7 +259,7 @@ sh-5.0$ buildah info
Now create some files for testing. Now create some files for testing.
This container test file excersises at least some of the critical parts of building an image (package update/installation, execution of commands, and use of volumes). This container test file exercises at least some of the critical parts of building an image (package update/installation, execution of commands, and use of volumes).
````console ````console
sh-5.0$ cat > test-script.sh <<EOF sh-5.0$ cat > test-script.sh <<EOF

View File

@ -21,7 +21,7 @@
# if the second field is cleanup, the script will remove all images from the # if the second field is cleanup, the script will remove all images from the
# specified builder. # specified builder.
# #
# The script does not check for conflicts on nameing. # The script does not check for conflicts on naming.
# #
# Outputs file: # Outputs file:
# #

View File

@ -938,7 +938,7 @@ func IsolationOption(isolation string) (buildah.Isolation, error) {
} }
// Device parses device mapping string to a src, dest & permissions string // Device parses device mapping string to a src, dest & permissions string
// Valid values for device looklike: // Valid values for device look like:
// '/dev/sdc" // '/dev/sdc"
// '/dev/sdc:/dev/xvdc" // '/dev/sdc:/dev/xvdc"
// '/dev/sdc:/dev/xvdc:rwm" // '/dev/sdc:/dev/xvdc:rwm"

2
run.go
View File

@ -27,7 +27,7 @@ const (
WithTerminal WithTerminal
) )
// String converts a TerminalPoliicy into a string. // String converts a TerminalPolicy into a string.
func (t TerminalPolicy) String() string { func (t TerminalPolicy) String() string {
switch t { switch t {
case DefaultTerminal: case DefaultTerminal:

View File

@ -489,14 +489,14 @@ func (b *Builder) setupMounts(mountPoint string, spec *specs.Spec, bundlePath st
return errors.Wrapf(err, "error determining work directory for container %q", b.ContainerID) return errors.Wrapf(err, "error determining work directory for container %q", b.ContainerID)
} }
// Figure out which UID and GID to tell the subscritions package to use // Figure out which UID and GID to tell the subscriptions package to use
// for files that it creates. // for files that it creates.
rootUID, rootGID, err := util.GetHostRootIDs(spec) rootUID, rootGID, err := util.GetHostRootIDs(spec)
if err != nil { if err != nil {
return err return err
} }
// Get the list of subscriptionss mounts. // Get the list of subscriptions mounts.
secretMounts := subscriptions.MountsWithUIDGID(b.MountLabel, cdir, b.DefaultMountsFilePath, mountPoint, int(rootUID), int(rootGID), unshare.IsRootless(), false) secretMounts := subscriptions.MountsWithUIDGID(b.MountLabel, cdir, b.DefaultMountsFilePath, mountPoint, int(rootUID), int(rootGID), unshare.IsRootless(), false)
// Add temporary copies of the contents of volume locations at the // Add temporary copies of the contents of volume locations at the

View File

@ -15,11 +15,11 @@ load helpers
run_buildah 0 logout docker.io run_buildah 0 logout docker.io
} }
@test "authenticate: logout should fail with nonexist authfile" { @test "authenticate: logout should fail with nonexistent authfile" {
run_buildah 0 login --username testuserfoo --password testpassword docker.io run_buildah 0 login --username testuserfoo --password testpassword docker.io
run_buildah 125 logout --authfile /tmp/nonexist docker.io run_buildah 125 logout --authfile /tmp/nonexistent docker.io
expect_output "error checking authfile path /tmp/nonexist: stat /tmp/nonexist: no such file or directory" expect_output "error checking authfile path /tmp/nonexistent: stat /tmp/nonexistent: no such file or directory"
run_buildah 0 logout docker.io run_buildah 0 logout docker.io
} }

View File

@ -948,7 +948,7 @@ function _test_http() {
run_buildah from ${target} run_buildah from ${target}
} }
# Following flags are configured to result in noop but should not affect buildiah bud behavior # Following flags are configured to result in noop but should not affect buildah bud behavior
@test "bud with --cache-from noop flag" { @test "bud with --cache-from noop flag" {
target=noop-image target=noop-image
run_buildah bud --cache-from=invalidimage --signature-policy ${TESTSDIR}/policy.json -t ${target} -f Dockerfile.noop-flags ${TESTSDIR}/bud/run-scenarios run_buildah bud --cache-from=invalidimage --signature-policy ${TESTSDIR}/policy.json -t ${target} -f Dockerfile.noop-flags ${TESTSDIR}/bud/run-scenarios
@ -1560,7 +1560,7 @@ function _test_http() {
expect_output --substring "\-rw\-rw\-r\-\-" expect_output --substring "\-rw\-rw\-r\-\-"
} }
@test "buidah bud --volume" { @test "buildah bud --volume" {
voldir=${TESTDIR}/bud-volume voldir=${TESTDIR}/bud-volume
mkdir -p ${voldir} mkdir -p ${voldir}
@ -2007,9 +2007,9 @@ _EOF
expect_output --substring "COMMIT pull" expect_output --substring "COMMIT pull"
} }
@test "bud with Containerfile should fail with nonexist authfile" { @test "bud with Containerfile should fail with nonexistent authfile" {
target=alpine-image target=alpine-image
run_buildah 125 bud --authfile /tmp/nonexist --signature-policy ${TESTSDIR}/policy.json -t ${target} ${TESTSDIR}/bud/containerfile run_buildah 125 bud --authfile /tmp/nonexistent --signature-policy ${TESTSDIR}/policy.json -t ${target} ${TESTSDIR}/bud/containerfile
} }
@test "bud COPY with URL should fail" { @test "bud COPY with URL should fail" {

View File

@ -110,11 +110,11 @@ load helpers
run_buildah commit --signature-policy ${TESTSDIR}/policy.json $cid run_buildah commit --signature-policy ${TESTSDIR}/policy.json $cid
} }
@test "commit should fail with nonexist authfile" { @test "commit should fail with nonexistent authfile" {
_prefetch alpine _prefetch alpine
run_buildah from --quiet --pull --signature-policy ${TESTSDIR}/policy.json alpine run_buildah from --quiet --pull --signature-policy ${TESTSDIR}/policy.json alpine
cid=$output cid=$output
run_buildah 125 commit --authfile /tmp/nonexist --signature-policy ${TESTSDIR}/policy.json $cid alpine-image run_buildah 125 commit --authfile /tmp/nonexistent --signature-policy ${TESTSDIR}/policy.json $cid alpine-image
} }
@test "commit-builder-identity" { @test "commit-builder-identity" {

View File

@ -714,7 +714,7 @@ type FSHeader struct {
UID int `json:"uid"` UID int `json:"uid"`
GID int `json:"gid"` GID int `json:"gid"`
ModTime time.Time `json:"mtime,omitempty"` ModTime time.Time `json:"mtime,omitempty"`
Devmajor int64 `json:"devmanor,omitempty"` Devmajor int64 `json:"devmajor,omitempty"`
Devminor int64 `json:"devminor,omitempty"` Devminor int64 `json:"devminor,omitempty"`
Xattrs map[string]string `json:"xattrs,omitempty"` Xattrs map[string]string `json:"xattrs,omitempty"`
Digest digest.Digest `json:"digest,omitempty"` Digest digest.Digest `json:"digest,omitempty"`

View File

@ -296,7 +296,7 @@ func (p *BuildAhTest) RestoreAllArtifacts() error {
//LineInOutputStartsWith returns true if a line in a //LineInOutputStartsWith returns true if a line in a
// session output starts with the supplied string // session output starts with the supplied string
func (s *BuildAhSession) LineInOuputStartsWith(term string) bool { func (s *BuildAhSession) LineInOutputStartsWith(term string) bool {
for _, i := range s.OutputToStringArray() { for _, i := range s.OutputToStringArray() {
if strings.HasPrefix(i, term) { if strings.HasPrefix(i, term) {
return true return true
@ -307,7 +307,7 @@ func (s *BuildAhSession) LineInOuputStartsWith(term string) bool {
//LineInOutputContains returns true if a line in a //LineInOutputContains returns true if a line in a
// session output starts with the supplied string // session output starts with the supplied string
func (s *BuildAhSession) LineInOuputContains(term string) bool { func (s *BuildAhSession) LineInOutputContains(term string) bool {
for _, i := range s.OutputToStringArray() { for _, i := range s.OutputToStringArray() {
if strings.Contains(i, term) { if strings.Contains(i, term) {
return true return true

View File

@ -50,7 +50,7 @@ load helpers
} }
@test "from-tagged-image" { @test "from-tagged-image" {
# Github #396: Make sure the container name starts with the correct image even when it's tagged. # GitHub #396: Make sure the container name starts with the correct image even when it's tagged.
run_buildah from --pull=false --signature-policy ${TESTSDIR}/policy.json scratch run_buildah from --pull=false --signature-policy ${TESTSDIR}/policy.json scratch
cid=$output cid=$output
run_buildah commit --signature-policy ${TESTSDIR}/policy.json "$cid" scratch2 run_buildah commit --signature-policy ${TESTSDIR}/policy.json "$cid" scratch2
@ -61,7 +61,7 @@ load helpers
run_buildah rm $output run_buildah rm $output
run_buildah rmi scratch2 scratch3 run_buildah rmi scratch2 scratch3
# Github https://github.com/containers/buildah/issues/396#issuecomment-360949396 # GitHub https://github.com/containers/buildah/issues/396#issuecomment-360949396
run_buildah from --quiet --pull=true --signature-policy ${TESTSDIR}/policy.json alpine run_buildah from --quiet --pull=true --signature-policy ${TESTSDIR}/policy.json alpine
cid=$output cid=$output
run_buildah rm $cid run_buildah rm $cid

View File

@ -254,7 +254,7 @@ function expect_output() {
fi fi
# This is a multi-line message, which may in turn contain multi-line # This is a multi-line message, which may in turn contain multi-line
# output, so let's format it ourself, readably # output, so let's format it ourselves, readably
local -a actual_split local -a actual_split
readarray -t actual_split <<<"$actual" readarray -t actual_split <<<"$actual"
printf "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" >&2 printf "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" >&2

View File

@ -103,11 +103,11 @@ IMAGE_LIST_S390X_INSTANCE_DIGEST=sha256:882a20ee0df7399a445285361d38b711c299ca09
run_buildah 125 manifest inspect foo run_buildah 125 manifest inspect foo
} }
@test "manifest-push should fail with nonexist authfile" { @test "manifest-push should fail with nonexistent authfile" {
run_buildah manifest create foo run_buildah manifest create foo
run_buildah manifest add --override-arch=arm64 foo ${IMAGE_LIST} run_buildah manifest add --override-arch=arm64 foo ${IMAGE_LIST}
run_buildah manifest inspect foo run_buildah manifest inspect foo
run_buildah 125 manifest push --authfile /tmp/nonexist --signature-policy ${TESTSDIR}/policy.json --purge foo dir:${TESTDIR}/pushed run_buildah 125 manifest push --authfile /tmp/nonexistent --signature-policy ${TESTSDIR}/policy.json --purge foo dir:${TESTDIR}/pushed
} }

View File

@ -76,7 +76,7 @@ load helpers
expect_output "Non-docker transport is not supported, for --all-tags pulling" expect_output "Non-docker transport is not supported, for --all-tags pulling"
} }
@test "pull-from-docker-deamon" { @test "pull-from-docker-daemon" {
run systemctl status docker run systemctl status docker
if [[ ! "$output" =~ "active (running)" ]] if [[ ! "$output" =~ "active (running)" ]]
then then
@ -164,8 +164,8 @@ load helpers
expect_output --substring 'pull from registry at "docker.io" denied by policy: not in allowed registries list' expect_output --substring 'pull from registry at "docker.io" denied by policy: not in allowed registries list'
} }
@test "pull should fail with nonexist authfile" { @test "pull should fail with nonexistent authfile" {
run_buildah 125 pull --authfile /tmp/nonexist --signature-policy ${TESTSDIR}/policy.json alpine run_buildah 125 pull --authfile /tmp/nonexistent --signature-policy ${TESTSDIR}/policy.json alpine
} }
@test "pull encrypted local image" { @test "pull encrypted local image" {

View File

@ -86,13 +86,13 @@ load helpers
expect_output --substring "docker://busybox" expect_output --substring "docker://busybox"
} }
@test "push should fail with nonexist authfile" { @test "push should fail with nonexistent authfile" {
_prefetch alpine _prefetch alpine
run_buildah from --quiet --pull --signature-policy ${TESTSDIR}/policy.json alpine run_buildah from --quiet --pull --signature-policy ${TESTSDIR}/policy.json alpine
cid=$output cid=$output
run_buildah images -q run_buildah images -q
imageid=$output imageid=$output
run_buildah 125 push --signature-policy ${TESTSDIR}/policy.json --authfile /tmp/nonexsit $imageid dir:${TESTDIR}/my-tmp-dir run_buildah 125 push --signature-policy ${TESTSDIR}/policy.json --authfile /tmp/nonexistent $imageid dir:${TESTDIR}/my-tmp-dir
} }
@test "push-denied-by-registry-sources" { @test "push-denied-by-registry-sources" {

View File

@ -4,7 +4,7 @@
# #
# Meant to run on a freshly installed VM. # Meant to run on a freshly installed VM.
# Installs the latest Git and Buildah and then # Installs the latest Git and Buildah and then
# Builds and installs Buildah's RPM in a Buidah Container. # Builds and installs Buildah's RPM in a Buildah Container.
# The baseline test is then run on this vm and then the # The baseline test is then run on this vm and then the
# newly created BUILDAH rpm is installed and the baseline # newly created BUILDAH rpm is installed and the baseline
# test is rerun. # test is rerun.