Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kola/test/oem: add ignition OEM test #235

Merged
merged 2 commits into from
Sep 22, 2021
Merged

Conversation

tormath1
Copy link
Contributor

Signed-off-by: Mathieu Tortuyaux [email protected]

In this PR, we try to test the usage of OEM - which is too required to run tests for the "new" ignition(v2/v3)

Closes: flatcar/Flatcar#486

Three tests:

  • try to reuse the partition using a btrfs format
  • try to reuse the parition using ext4 format
  • wipe the partition by using wipeFilesystem

How to use

$ ./bin/kola list | grep oem
cl.ignition.oem.regular			[all]								[all]		[cl]		[all]		[all]
cl.ignition.oem.reuse			[all]								[all]		[cl]		[all]		[all]
cl.ignition.oem.wipe			[all]								[all]		[all]		[all]		[all]

Testing done

Only on qemu.

@tormath1 tormath1 self-assigned this Sep 21, 2021
@tormath1 tormath1 marked this pull request as ready for review September 21, 2021 15:04
@tormath1 tormath1 requested a review from a team September 21, 2021 15:04

// reusePartition asserts that even if the config uses a different fs format, we keep using `btrfs`.
func reusePartition(c cluster.TestCluster) {
out := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT -J | jq -r '.blockdevices | .[] | select(.label=="OEM") | .fstype'`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually prefer to use long options in scripts and code, leaving short flags for daily use in the terminal. I think it improves readability.

Suggested change
out := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT -J | jq -r '.blockdevices | .[] | select(.label=="OEM") | .fstype'`)
out := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT --json | jq -r '.blockdevices | .[] | select(.label=="OEM") | .fstype'`)


// wipeOEM asserts that if the config uses a different fs format with a wipe of the fs we effectively wipe the fs.
func wipeOEM(c cluster.TestCluster) {
out := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT -J | jq -r '.blockdevices | .[] | select(.label=="OEM") | .fstype'`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Suggested change
out := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT -J | jq -r '.blockdevices | .[] | select(.label=="OEM") | .fstype'`)
out := c.MustSSH(c.Machines()[0], `lsblk --output FSTYPE,LABEL,MOUNTPOINT --json | jq -r '.blockdevices | .[] | select(.label=="OEM") | .fstype'`)

Run: reusePartition,
ClusterSize: 1,
Distros: []string{"cl"},
UserData: conf.ContainerLinuxConfig(`storage:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be gated behind a minimal release version 2983.0.0

@tormath1
Copy link
Contributor Author

@pothos @krnowak thanks for your reviews - comments have been addressed :)

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1 tormath1 force-pushed the tormath1/add-oem-test branch from 2ddaec8 to 1a7dcc8 Compare September 22, 2021 08:55
@tormath1 tormath1 merged commit e755e55 into flatcar-master Sep 22, 2021
@tormath1 tormath1 deleted the tormath1/add-oem-test branch September 22, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add kola test for using the OEM partition with Ignition
3 participants