summaryrefslogtreecommitdiff
path: root/test/system
Commit message (Collapse)AuthorAge
* implement 'make remotesystem'Ed Santiago2019-08-08
| | | | | | | | | | | | | | | | | | | | | podman-remote rm now works; that's the only thing we were waiting for to enable podman-remote (varlink) system tests. Add a (too-complicated, sorry) Makefile target that will define a random socket path, start the podman varlink server, and run the test suite using podman-remote. Also: add two convenience functions, is_rootless and is_remote, and use those in skip_if_rootless/if_remote and elsewhere Also: workarounds for broken tests: - basic version test: podman-remote emits an empty 'Client' line. Just ignore it. - looks like 'podman-remote pod' doesn't work; skip test. Also: minor documentation update Signed-off-by: Ed Santiago <santiago@redhat.com>
* pod top test: reenableEd Santiago2019-08-06
| | | | | | | It looks like #2780 is fixed: an overnight run yielded no instances of 'pod top' returning incomplete output. Signed-off-by: Ed Santiago <santiago@redhat.com>
* System tests: resolve hang in rawhide rootlessEd Santiago2019-08-01
| | | | | | | | | | | | | | | | | | | Fedora CI tests are failing on rawhide under kernel 5.3.0-0.rc1.git3.1.fc31 (rhbz#1736758). But there's another insidious failure, a 4-hour hang in the rootless tests on the same CI system. The culprit line is in the podman build test, but it's actually BATS itself that hangs, not the build command -- which suggests that it's the usual FD 3 problem (see BATS README). It would seem that podman is forking a process that inherits fd 3 but that process is not getting cleaned up when podman crashes upon encountering the kernel bug. Today it's podman build, tomorrow it might be something else. Let's just run all podman invocations in run_podman with a non-bats FD 3. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Allow info test to work with usernames w/dashMajor Hayden2019-07-29
| | | | | | | | | | The regular expression used in the `info` test does not allow for usernames that have a dash, such as `test-user`. This patch adjusts the regex to allow for a dash. Fixes #3666. Signed-off-by: Major Hayden <major@redhat.com>
* Merge pull request #3497 from QazerLab/bugfix/systemd-generate-pidfileOpenShift Merge Robot2019-07-08
|\ | | | | Use conmon pidfile in generated systemd unit as PIDFile.
| * Move skipping systemd tests to early setup.Danila Kiver2019-07-06
| | | | | | | | | | | | | | There is no meaning of performing setup/teardown for these tests when we even can not work with systemd. Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
| * Reload systemd daemon on creation of units location dir in tests.Danila Kiver2019-07-06
| | | | | | | | | | | | | | | | Systemd manager drops non-existent directories from the units search path during initialization, thus, creation of UNIT_DIR, if it did not exist before, requres reloading the daemon. Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
| * Add debug information to "generate systemd" test.Danila Kiver2019-07-06
| | | | | | | | Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
| * Use conmon pidfile in generated systemd unit as PIDFile.Danila Kiver2019-07-04
| | | | | | | | | | | | | | | | | | | | | | By default, podman points PIDFile in generated unit file to non-existent location. As a result, the unit file, generated by podman, is broken: an attempt to start this unit without prior modification results in a crash, because systemd can not find the pidfile of service's main process. Fix the value of "PIDFile" and add a system test for this case. Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
* | Add RUN priv'd test for buildTomSweeneyRedHat2019-06-28
|/ | | | | | | | | Podman 1.4.1 had problems with builds with a RUN command that tried to to a privliged command. This adds a gating test for that situation. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* run BATS tests in CirrusEd Santiago2019-06-17
| | | | | | | | | | | | | | | | | | | | | I'm running the BATS tests manually once in a while, and catching several problems each week that make it past the rest of CI. Since the BATS tests run at RPM gating time, we need to catch problems earlier. Try running the tests from Cirrus. Tests will be skipped on Ubuntu due to a too-ancient version of coreutils (8.28; the 'timeout -v' we use requires 8.29). Tests are run *after* integration tests, even though these take three minutes and would be nice to have fail quickly, because running before causes bizarre CI failures. Shrug. UPDATE: also fix run test, broken by #3311. Signed-off-by: Ed Santiago <santiago@redhat.com>
* BATS tests - get working againEd Santiago2019-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <santiago@redhat.com>
* bats - various small updatesEd Santiago2019-04-18
| | | | | | | | | | | | | | - podman-remote: - enable log, run and build tests, they're working now - well, except build + rootless. Skip that one. - add explanation of why info test is skipped - Giuseppe's permission test: - validate GraphRoot and RunRoot values - add verbose logging, to enable seeing full directory tree permissions on error Signed-off-by: Ed Santiago <santiago@redhat.com>
* Merge pull request #2907 from edsantiago/uidmap_test_fixOpenShift Merge Robot2019-04-12
|\ | | | | new uidmap BATS test: fix
| * new uidmap BATS test: fixEd Santiago2019-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various problems, one of which was causing the test to fail completely (otherwise I wouldn't have caught the others): - option is --uidmap, not --uidmapping - run_podman cannot be piped (| grep /sys/kernel). That's an unfortunate limitation of BATS. Any invocation of 'run' saves results to $output, which then has to be tested in a separate step. - do so, using 'run' and 'grep' and 'is' to produce readable messages on failure - remove "$expected_rc", that looks like a copy/paste bug from a few lines above. Skip entire test if rootless. (The one without --net=host passes, but it also passes with older podman as both root and rootless. I don't think it's actually testing anything, but agree with leaving it in to catch weird regressions). We really need to get these tests running in CI. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | Merge pull request #2889 from edsantiago/batsOpenShift Merge Robot2019-04-11
|\ \ | |/ |/| BATS tests: start supporting podman-remote
| * BATS tests: start supporting podman-remoteEd Santiago2019-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | podman-remote now supports rm! That's what we needed to start running BATS tests. Although most tests don't actually work, some do, and maybe the rest will start working over time. For now, disable them. The only significant difference found is that podman-remote strips fractional seconds from timestamps in JSON output. Probably not something worth caring about. Signed-off-by: Ed Santiago <santiago@redhat.com>
* | userns: prevent /sys/kernel/* paths in the containerGiuseppe Scrivano2019-04-11
|/ | | | | | | | | | | | | | | | | when we run in a user namespace, there are cases where we have not enough privileges to mount a fresh sysfs on /sys. To circumvent this limitation, we rbind /sys from the host. This carries inside of the container also some mounts we probably don't want to. We are also limited by the kernel to use rbind instead of bind, as allowing a bind would uncover paths that were not previously visible. This is a slimmed down version of the intermediate mount namespace logic we had before, where we only set /sys to slave, so the umounts done to the storage by the cleanup process are propagated back to the host. We also don't setup any new directory, so there is no additional cleanup to do. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* test: test that an unprivileged user cannot access the storageEd Santiago2019-03-29
| | | | | Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Sigh; disable pod-top test, it's unreliable (#2780)Ed Santiago2019-03-27
| | | | Signed-off-by: Ed Santiago <santiago@redhat.com>
* BATS: new tests, and improvements to existing onesEd Santiago2019-03-18
| | | | | | | | | | | | | | | | | | | | | New: - podman exec - podman load (requires #2674) - CLI parsing (regression test for #2574) Improved: - help: test "podman NoSuchCommand", and subcommands - help: test "podman cmd" without required args - pod: start with --infra=false; this allows running rootless - log: also run 'logs' after container is run - log: test -f with two containers Also, use helpful descriptions for skip_if_rootless Tested on f29, root and rootless. As soon as podman-remote supports rm, I'll start testing that too. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Merge pull request #2257 from cevich/system_test_beginningOpenShift Merge Robot2019-03-08
|\ | | | | [ci skip] System-test: Begin list of needed high-level tests
| * System-test: Documentation and TODO listChris Evich2019-03-06
| | | | | | | | Signed-off-by: Chris Evich <cevich@redhat.com>
* | Implement review feedbackEd Santiago2019-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - document a recommended convention for fail-fast tests - document the requirement for jq. (And, add a fail-fast test for its presence; remove the duplicated checks in subtests) - add further sanity checks to 'help' test. Add missing documentation. Remove a no-longer-needed workaround for usage-message bug fixed in #2486 - add a documented TEMPLATE - and, since we're at 1.1, enable 'Remote API' check in version test - better diagnostics in setup/teardown; add vim filetype hint; better formatting of actual-vs-expect errors - new pod-top, logs, build tests - improve error messages - add $IMAGE alias for ridiculous $PODMAN_TEST_IMAGE_FQN - final cleanup, in prep for merge Signed-off-by: Ed Santiago <santiago@redhat.com>
* | new system tests under BATSEd Santiago2019-03-07
|/ | | | | | | | | | | | | | | Initial attempt at writing a framework for podman system tests. The idea is to define a useful set of primitives that will make it easy to write actual tests and to interpret results of failing ones. This is a proof-of-concept right now; only a small number of tests, by no means comprehensive. I am requesting review in order to find showstopper problems: reasons why this approach cannot work. Should there be none, we can work toward running these as gating tests for Fedora and RHEL8. Signed-off-by: Ed Santiago <santiago@redhat.com>
* The system test write with ginkgoYiqiao Pu2018-11-16
The tests can be filter by --focus and --skip to fit different test target. Also be able to set global options and cmd options by export it to ENV to fit different test matrix. Signed-off-by: Yiqiao Pu <ypu@redhat.com>