summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-11 21:21:33 +0200
committerGitHub <noreply@github.com>2019-06-11 21:21:33 +0200
commitc385f33cdf5e480b4c3f03227989cd56563d9cc0 (patch)
treeb9aebcba7b70902b88babbcc34ba6ee37849c701
parent130f6cba8c3cf78948c80930fa81f476cd32cc3b (diff)
parent9f49c1af46f9272c25db44c6e3e6ff9ec96aad4c (diff)
downloadpodman-c385f33cdf5e480b4c3f03227989cd56563d9cc0.tar.gz
podman-c385f33cdf5e480b4c3f03227989cd56563d9cc0.tar.bz2
podman-c385f33cdf5e480b4c3f03227989cd56563d9cc0.zip
Merge pull request #3290 from edsantiago/bats
BATS tests - get working again
-rw-r--r--cmd/podman/restore.go18
-rw-r--r--docs/podman-container-restore.1.md4
-rw-r--r--test/system/005-info.bats4
-rw-r--r--test/system/120-load.bats4
4 files changed, 23 insertions, 7 deletions
diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go
index 9c77d4a5e..6e445e5df 100644
--- a/cmd/podman/restore.go
+++ b/cmd/podman/restore.go
@@ -76,8 +76,22 @@ func restoreCmd(c *cliconfig.RestoreValues, cmd *cobra.Command) error {
return errors.Errorf("--tcp-established cannot be used with --name")
}
- if (c.Import != "") && (c.All || c.Latest) {
- return errors.Errorf("Cannot use --import and --all or --latest at the same time")
+ argLen := len(c.InputArgs)
+ if c.Import != "" {
+ if c.All || c.Latest {
+ return errors.Errorf("Cannot use --import with --all or --latest")
+ }
+ if argLen > 0 {
+ return errors.Errorf("Cannot use --import with positional arguments")
+ }
}
+
+ if (c.All || c.Latest) && argLen > 0 {
+ return errors.Errorf("no arguments are needed with --all or --latest")
+ }
+ if argLen < 1 && !c.All && !c.Latest && c.Import == "" {
+ return errors.Errorf("you must provide at least one name or id")
+ }
+
return runtime.Restore(getContext(), c, options)
}
diff --git a/docs/podman-container-restore.1.md b/docs/podman-container-restore.1.md
index 5b94cd2fa..c96a37f80 100644
--- a/docs/podman-container-restore.1.md
+++ b/docs/podman-container-restore.1.md
@@ -45,8 +45,8 @@ connections.
**--import, -i**
Import a checkpoint tar.gz file, which was exported by Podman. This can be used
-to import a checkpointed container from another host. It is not necessary to specify
-a container when restoring from an exported checkpoint.
+to import a checkpointed container from another host. Do not specify a *container*
+argument when using this option.
**--name, -n**
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index 47c7a52fc..0068e35a9 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -14,7 +14,7 @@ Distribution:
OCIRuntime:\\\s\\\+package:
os:
rootless:
-insecure registries:
+registries:
store:
GraphDriverName:
GraphRoot:
@@ -37,9 +37,7 @@ RunRoot:
tests="
host.BuildahVersion | [0-9.]
-host.Conmon.package | $expr_nvr
host.Conmon.path | $expr_path
-host.OCIRuntime.package | $expr_nvr
host.OCIRuntime.path | $expr_path
store.ConfigFile | $expr_path
store.GraphDriverName | [a-z0-9]\\\+\\\$
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index dedfe6172..f2dedb73f 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -87,6 +87,10 @@ verify_iid_and_name() {
@test "podman load - will not read from tty" {
+ if [ ! -t 0 ]; then
+ skip "STDIN is not a tty"
+ fi
+
run_podman 125 load
is "$output" \
"Error: cannot read from terminal. Use command-line redirection" \