From bd0582dd3407a1f1ad5c38753d84243dcdf63102 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 6 May 2019 06:11:10 -0600 Subject: BATS tests - get working again Various small fixes to get BATS tests working again. Split from #2947 because that one keeps getting stalled, and I'm hoping these separate changes get approved. I consider these changes urgent because RHEL8 gating tests are failing, and will fail even more if/when #2272 gets picked up and packaged for RHEL8, and I consider it important to have clean passing tests for RHEL8. * info test: 'insecure registries' is gone. A recent commit (d1a7378aa) changed the format of 'podman info', removing the 'insecure registries' key. Deal with it. * info test: remove check for .host.{Conmon,OCIRuntime}.package; the value on f28 and f29 is 'Unknown' (instead of an NVR). We can live without this check. * 'load' test: skip when running in CI, because stdin is not a tty. * container restore: fix arg processing. #2272 broke argument processing: 'podman container restore', with no args, should exit with 'argument required' error. Root cause is that the new --import option takes the place of an argument, so the checkAllAndLatest() call had to be changed to not exit on error. Workaround is (sigh) to copy/paste the skipped checkAllAndLatest() code, with minor tweaks to accommodate --import. Signed-off-by: Ed Santiago --- cmd/podman/restore.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmd/podman') diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go index 9c77d4a5e..4d715ad4f 100644 --- a/cmd/podman/restore.go +++ b/cmd/podman/restore.go @@ -79,5 +79,14 @@ func restoreCmd(c *cliconfig.RestoreValues, cmd *cobra.Command) error { 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.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) } -- cgit v1.2.3-54-g00ecf