-
Notifications
You must be signed in to change notification settings - Fork 17
kola: Add test case for extra partition creation #457
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ import ( | |
| "github.com/coreos/go-semver/semver" | ||
| "github.com/flatcar/mantle/kola/cluster" | ||
| "github.com/flatcar/mantle/kola/register" | ||
| "github.com/flatcar/mantle/kola/tests/util" | ||
| "github.com/flatcar/mantle/platform/conf" | ||
| ) | ||
|
|
||
|
|
@@ -322,6 +323,17 @@ systemd: | |
| Platforms: []string{"qemu", "qemu-unpriv"}, | ||
| MinVersion: semver.Version{Major: 3033}, | ||
| }) | ||
|
|
||
| register.Register(®ister.Test{ | ||
| // Note: As long as the initrd does not mount /var for early | ||
| // preparations, the resulting system has a few issues, so this setup is | ||
| // not fully supported yet | ||
| Name: "cl.ignition.partition_on_boot_disk", | ||
| Run: testPartitionOnBootDisk, | ||
| ClusterSize: 0, | ||
| Distros: []string{"cl"}, | ||
| Platforms: []string{"qemu", "qemu-unpriv"}, | ||
| }) | ||
| } | ||
|
|
||
| var ext4NoClobberV2_1 = conf.Ignition(`{ | ||
|
|
@@ -437,3 +449,48 @@ func testSwapActivation(c cluster.TestCluster) { | |
| c.Fatalf("swap's size should be: %s, got %s", swapSize, size) | ||
| } | ||
| } | ||
|
|
||
| var rootDiskExtraPartition = conf.ContainerLinuxConfig(` | ||
| storage: | ||
| disks: | ||
| - device: /dev/disk/by-id/virtio-primary-disk | ||
| partitions: | ||
| - label: VAR | ||
| number: 10 | ||
| start: '9GiB' | ||
| filesystems: | ||
| - name: VAR | ||
| mount: | ||
| device: /dev/disk/by-partlabel/VAR | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
we don't populate
It's not about the mountpoint at all, it's about adding partitions to a partitioned disk (that's why this was in For sure we need a testcase that ensures we don't break backwards compat with ignition v2/CLC.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do, that's in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: The topic of separate
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What we can also do in Flatcar is to define a partition or filesystem label to expect and then add a mount unit for that (it can be compatible with a future systemd cmdline way by having this mount unit only be set up if the cmdline option is not there, I think we have similar logic for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Started something for supporting separate
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be good to write some files here with Ignition. We also have to add one more test case with Butane an defining the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so i added the file creation part, but not the butane yet |
||
| format: xfs | ||
| label: VAR | ||
| files: | ||
| - filesystem: VAR | ||
| path: /hello | ||
| mode: 0644 | ||
| contents: | ||
| inline: world | ||
| - filesystem: root | ||
| path: /etc/fstab | ||
| mode: 0644 | ||
| contents: | ||
| inline: | | ||
| /dev/disk/by-label/VAR /var xfs defaults 0 0 | ||
| `) | ||
|
|
||
| func testPartitionOnBootDisk(c cluster.TestCluster) { | ||
| m, err := util.NewMachineWithLargeDisk(c, "10G", rootDiskExtraPartition) | ||
| if err != nil { | ||
| c.Fatal(err) | ||
| } | ||
| out := c.MustSSH(m, "lsblk -f") | ||
| c.Logf("lsblk -f:\n%s", out) | ||
| out = c.MustSSH(m, "findmnt") | ||
| c.Logf("findmnt:\n%s", out) | ||
|
|
||
| c.MustSSH(m, "mountpoint /var") | ||
| c.MustSSH(m, "ls -la /dev/disk/by-partlabel/VAR") | ||
| c.MustSSH(m, "ls -la /dev/disk/by-label/VAR") | ||
| c.AssertCmdOutputContains(m, "findmnt /var", "xfs") | ||
| c.AssertCmdOutputContains(m, "cat /var/hello", "world") | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.