coreos / coreos-assembler

Tooling container to assemble CoreOS-like systems
https://coreos.github.io/coreos-assembler/
Apache License 2.0
330 stars 165 forks source link

rework iscsi tests architecture #3791

Open dustymabe opened 2 months ago

dustymabe commented 2 months ago

Right now we have two iscsi tests (and will soon have a 3rd) that all:

  1. start a VM
  2. pull down/start a targetd container
  3. Run coreos-installer to do an install with iscsi kargs set
  4. pull down coreos-assembler container to:
  5. spin up a nested VM using iPXE with sanboot options set

This makes for an extremely heavyweight test. It downloads two containers (cosa being a really large one) and relies on nested virtualization, which apparently doesn't work on multiarch.

I suggest that we re-architect this such that we

The idea here is that if a single one of the tests are called they will spin up the initial VM and run the test, but if multiple of the tests are called then the initial VM will only need to be setup once.

Benefits of this approach:

One potential model we could follow for this is what is currently done for the luks/tang tests in:

https://github.com/coreos/coreos-assembler/blob/79b15c89d57a4b97334c70881b036aee3462f1e4/mantle/kola/tests/ignition/luks.go#L124

jbtrystram commented 2 months ago

Note : we'd need some code to cleanup the iscsi volume between test to avoid coreos-installer trying to install on a non-empty disk. it may be a non-issue, i'm not sure, it's worth checking.

dustymabe commented 2 months ago

Installing to a non-empty disk should be a non-issue (coreos-installer will just happily overwrite what is there), but I'd be worried about false positives where the install from the previous test somehow was used for the next test, so I agree that it would be nice to start from a fresh disk each time.