1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-07 03:45:28 +01:00
Commit Graph

24 Commits

Author SHA1 Message Date
Xiaofeng Wang
3aada94752 test: Remove tmt bootc plugin code and use released bootc plugin
Remove tests-intetration folder because TMT bootc plugin replaces
tests-integration

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-12-07 14:33:13 +08:00
Colin Walters
3b61d2cadc Drop copy of tmt bootc plugin
It's now merged and shipped, and us having a copy breaks things.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-05 13:56:36 -05:00
Xiaofeng Wang
8f0f3d2d88 test: Remove e2e test
xref: https://github.com/containers/bootc/issues/868

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-12-04 08:28:54 -05:00
Chris Kyrouac
c0c4ccf8ee install: Check if running in container earlier
Previously, the check to verify install to-filesystem is being run
within a container happened fairly late in prepare_install. This moves
the check up before some of the other container specific checks. Now,
the error should occur when trying a basic install to-filesystem
invocation, e.g. `bootc install to-filesystem /var/mnt`.

This also adds a test to verify the error occurs with minimal arguments
and adds host_is_container to the global state.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-11-08 16:32:31 -05:00
Colin Walters
8fc788bf43 tests: Drop python tests
It's not useful to have two frameworks here, let's just use nushell.
ref https://github.com/containers/bootc/issues/868

Signed-off-by: Colin Walters <walters@verbum.org>
2024-11-06 17:25:27 -05:00
Chris Kyrouac
0f09ae234e tests: Add tmt test for bootc install with LBI
Along with the test, this will install the LBIs on the machine running
the tests prior to running the tests. Also refactors the existing LBI
test into a separate test plan to make room for the install tests.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-09-18 15:37:37 -04:00
Chris Kyrouac
9760f0f856 tests: Fix summary for logically bound tmt test
It was copied from the local-upgrade test.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-08-08 09:25:28 -04:00
Xiaofeng Wang
98201fec06 test: add centos stream 10 rpm build and e2e test
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-07-31 18:35:05 +08:00
Chris Kyrouac
35b1324d2a boundimage: Add tmt tests for bound images
These tests validate the basic use case of switching and upgrading
an image with bound images that need to be pulled.

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
2024-07-29 17:19:37 -04:00
Colin Walters
20d5146e1e tests: Split up tmt tests into separate plans
Because tmt right now doesn't support isolation automatically,
and many of the tests we'll want to write mutate the system,
we'll need to copy-paste the base plan.

This changes the `make test-tmt` to have its own little
tmt wrapper that dynamically scans the plans/ and sorts
them by a priority, then runs them one by one currently.

Closes: https://github.com/containers/bootc/issues/735

Signed-off-by: Colin Walters <walters@verbum.org>
2024-07-26 10:43:39 -04:00
Xiaofeng Wang
98b62ff558 test: run all podman in root mode with sudo
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-07-03 22:20:25 +08:00
Xiaofeng Wang
f5025dcb84 test: e2e test update
1. rename old integration test to e2e tet
2. drop aws test, use libvirt test (for bootc install to-existing-root
   and bootc switch test) instead
3. drop rhel test
4. replace quay.io registry by local registry

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-07-03 22:19:41 +08:00
Colin Walters
9a758e3a14 tests: Add pytest and nushell based tests
I've been trying to keep this project in "one" programming
language by writing even tests in Rust...but specifically
for our integration tests it's pretty painful not just to
compile them but have to deal with baking them into the base image.

The tmt framework is very GHA like in that it scrapes the
git source tree and copies it into the target environment, which
works really well with scripts.

Now, if you know me you know I am not a fan of dynamic programming
languages like bash and Python. I'm one of those folks that actually
tries to use Rust for things that feel like "scripts" i.e. they're
*mostly* about forking external processes (see the xtask/
crate which uses "xshell").

Some of our testing code is in Rust too. However...there's a giant
tension here because:

- Iteration speed is very important for tests and scripts
- The artifact being an architecture-dependent binary pushes us
  to inject it into container images; having the binary part
  of the bootc image under test conceptually forces us to reprovision
  for each test change, which is super expensive

Most other people when faced with the testing challenge would
just write shell scripts (or Python); that's definitely what tmt
expects people to do.

The podman project has a mix of a "bats" suite which is all
bash based, and a Go-based framework.

The thing is: bash is easy to mess up and has very little ability
to do static analysis. Go (and Python) are very verbose for forking external
processes.

I've been using https://www.nushell.sh/ for my interactive shell
for quite a while; I know just enough to get by day to day
(but honestly sometimes I still type "bash" and run a few things there
 that I know how to express in bash but not nu)

Anyways though, nushell has a lot of desirable properties for
tests (which are basically scripts):

- Architecture independent
- Running an external process requires zero ceremony; it's the
  default!
- But it *is* easy to e.g. scrape JSON from an external binary
  into a rich data structure
- A decently rich standard library

The downside is, it's a new language. And in the end, I'm
not going to say it's the only way to write tests...maybe we
do end up with some more bash. It wouldn't be the end of the world.
But...after playing with this, I definitely like the result.

OK, and after some debate we decided to add Python too, so this
demos a pytest test.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-24 13:46:13 -04:00
Xiaofeng Wang
a5630ca79d tmt: rename plan files: build.fmf to integration-build.fmf,
integration.fmf to integration-run.fmf

And rename tmt test from build-tmt.fmf to build-image.fmf

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-24 22:33:11 +08:00
Xiaofeng Wang
3b68e41746 tmt: rename tmt test log folder name to test-tmt-log
run-001 does not make any sense, change to test-tmt-log
add comments for tmt test log move

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-24 21:32:11 +08:00
Xiaofeng Wang
558c782198 test: give tmt vm 20G disk instead of 40G
Sometimes the deployed testing farm runner does not have big disk,
to avoid this issue, use smaller tmt vm disk instead

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-20 15:09:32 +08:00
Xiaofeng Wang
4b0f6a071e test: move tmt test log to tmt plan data folder
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-20 15:09:32 +08:00
Xiaofeng Wang
9a02584c0e test: install some build dependent packages with
dnf builddep bootc

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-19 23:08:32 +08:00
Xiaofeng Wang
f76ade8e74 test: run tmt integration test on testing farm
build.fmf: used to deploy testing farm runner and run
tmt integration on it
build-tmt.fmf: tmt test to work with discover.fmf which is
requited to make .git always present

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-06-19 15:03:20 +08:00
Colin Walters
36be46a9e3 tests-integration: Add basic local tmt flow
Part of https://github.com/containers/bootc/issues/543

I'm not totally happy with this, but it does demonstrate the basic
wiring flow of:

- `cargo xtask test-tmt`

That will do a container build, make a disk image from it,
and run a "hello world" tmt test.

A lot more to do here including wiring up our existing tests
into this, and deduplicating with the other integration tests.

A key aspect too will be exploring workflows that e.g. expose
a registry locally.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-17 10:37:18 -04:00
Xiaofeng Wang
be7f3452d2 test: some updates on test
1. add bootc swtich test
2. add bootc install to-disk test
3. cover more distros, like rhel 9.5, fedora 40 and 41(rawhide)

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-05-24 10:09:03 +08:00
Xiaofeng Wang
45d525a1f2 test: install ansible collection from tar.gz package
To avoid galaxy server unstable issue, like 504 gateway timeout,
error when getting available versions of collection community.general,
download two required collection packages and install then locally

Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-04-07 08:04:12 +08:00
Xiaofeng Wang
cd722a2cbf test: use aws-cli to deploy aws instance instead of ansible module
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-04-04 22:47:42 +08:00
Xiaofeng Wang
cd7e62d5aa test: add integration test
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
2024-03-06 17:10:43 +08:00