-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kola: Add test case for extra partition creation
This is a testcase for a regression that passes until Flatcar 3374 and fails on Flatcar 3510 (only checked stable releases). Signed-off-by: Jeremi Piotrowski <[email protected]>
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright The Mantle Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package ignition | ||
|
||
import ( | ||
"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" | ||
) | ||
|
||
const ( | ||
userdata = `{ | ||
"ignition": { "version": "2.3.0" }, | ||
"storage": { | ||
"disks": [ | ||
{ | ||
"device": "/dev/disk/by-id/virtio-primary-disk", | ||
"partitions": [ | ||
{ | ||
"label": "VAR", | ||
"number": 10, | ||
"startMiB": 9216 | ||
} | ||
] | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"filesystem": "root", | ||
"path": "/etc/fstab", | ||
"contents": { | ||
"source": "data:,%2Fdev%2Fdisk%2Fby-label%2Fvar%20%2Fvar%20xfs%20defaults%200%200%0A", | ||
"verification": {} | ||
}, | ||
"mode": 420 | ||
} | ||
], | ||
"filesystems": [ | ||
{ | ||
"mount": { | ||
"device": "/dev/disk/by-partlabel/VAR", | ||
"format": "xfs", | ||
"label": "var" | ||
}, | ||
"name": "var" | ||
} | ||
] | ||
}, | ||
"systemd": {} | ||
}` | ||
) | ||
|
||
func init() { | ||
register.Register(®ister.Test{ | ||
Name: "cl.ignition.partitions", | ||
Run: checkPartitions, | ||
ClusterSize: 0, | ||
Distros: []string{"cl"}, | ||
Platforms: []string{"qemu", "qemu-unpriv"}, | ||
}) | ||
} | ||
|
||
func checkPartitions(c cluster.TestCluster) { | ||
m, err := util.NewMachineWithLargeDisk(c, "10G", conf.Ignition(userdata)) | ||
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") | ||
} |