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

tests: create partition scheme test #2704

Merged

Conversation

lukewarmtemp
Copy link
Contributor

@lukewarmtemp lukewarmtemp commented Nov 1, 2023

Create a test to verify partition numbers and sizes. This is to ensure that the partition scheme is valid during the transition to using OSBuild in the FCOS pipeline.

Jira Issue: https://issues.redhat.com/browse/COS-2527

@lukewarmtemp lukewarmtemp marked this pull request as draft November 1, 2023 15:43
@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch from 299ae71 to 9f4ef6d Compare November 1, 2023 17:06
@dustymabe
Copy link
Member

we might need to add some special consideration here for 4k disks, though hmm, do these tests even run for 4k disks or is that just testiso tests?

@lukewarmtemp
Copy link
Contributor Author

we might need to add some special consideration here for 4k disks, though hmm, do these tests even run for 4k disks or is that just testiso tests?

Oh it didn't even cross my mind to test the different platforms. I just ran it on the qcow2 built by OSBuild and COSA, but I can try running it for different platforms and see what the outputs are.

@dustymabe
Copy link
Member

dustymabe commented Nov 2, 2023

we might need to add some special consideration here for 4k disks, though hmm, do these tests even run for 4k disks or is that just testiso tests?

Oh it didn't even cross my mind to test the different platforms. I just ran it on the qcow2 built by OSBuild and COSA, but I can try running it for different platforms and see what the outputs are.

Like I said 4k disks probably won't be able to be tested with this because I think the only place we can use those is for bare metal and we only test the bare metal images using our testiso stuff.

But... having this test run everywhere (like AWS, GCP, etc) is useful, so making it a test that isn't limited to qemu will have value I think.

@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch 3 times, most recently from 258abbc to b9c706a Compare November 16, 2023 15:51
@lukewarmtemp
Copy link
Contributor Author

lukewarmtemp commented Nov 16, 2023

But... having this test run everywhere (like AWS, GCP, etc) is useful, so making it a test that isn't limited to qemu will have value I think.

Test runs on AWS successfully.

@lukewarmtemp lukewarmtemp marked this pull request as ready for review November 16, 2023 15:51
@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch 3 times, most recently from c6624fc to 1487bce Compare November 20, 2023 20:16
@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch from 1487bce to 45c2a27 Compare November 22, 2023 16:35
@lukewarmtemp
Copy link
Contributor Author

A point of investigation: the qcow2 created by OSBuild does not have the partlabel field

lsblk --json --bytes -o NAME,FSTYPE,START,SIZE,MOUNTPOINT,PARTLABEL,PARTTYPENAME,LOG-SEC "$disk_name" | jq '.blockdevices[]'
{
  "name": "vda",
  "fstype": null,
  "start": null,
  "size": 10737418240,
  "mountpoint": null,
  "partlabel": null,
  "parttypename": null,
  "log-sec": 512,
  "children": [
    {
      "name": "vda1",
      "fstype": null,
      "start": 2048,
      "size": 1048576,
      "mountpoint": null,
      "partlabel": null,
      "parttypename": "BIOS boot",
      "log-sec": 512
    },
    {
      "name": "vda2",
      "fstype": "vfat",
      "start": 4096,
      "size": 133169152,
      "mountpoint": null,
      "partlabel": null,
      "parttypename": "EFI System",
      "log-sec": 512
    },
    {
      "name": "vda3",
      "fstype": "ext4",
      "start": 264192,
      "size": 402653184,
      "mountpoint": "/boot",
      "partlabel": null,
      "parttypename": "Linux filesystem",
      "log-sec": 512
    },
    {
      "name": "vda4",
      "fstype": "xfs",
      "start": 1050624,
      "size": 10199481856,
      "mountpoint": "/sysroot",
      "partlabel": null,
      "parttypename": "Linux filesystem",
      "log-sec": 512
    }
  ]
}

@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch 3 times, most recently from 104bbfd to 13a364c Compare November 22, 2023 16:44
@dustymabe
Copy link
Member

A point of investigation: the qcow2 created by OSBuild does not have the partlabel field

yep. definitely something that may be causing us problems. We'll need to remedy that I think.

dustymabe added a commit to dustymabe/coreos-assembler that referenced this pull request Nov 28, 2023
This will make the partitions get a partition label, which we rely
on. See coreos/fedora-coreos-config#2704 (comment)
@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch 2 times, most recently from a447f90 to bb22c43 Compare November 28, 2023 21:08
tests/kola/disks/partition-scheme Outdated Show resolved Hide resolved
tests/kola/disks/partition-scheme Outdated Show resolved Hide resolved
@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch 2 times, most recently from c90c387 to f920948 Compare November 28, 2023 21:33
@dustymabe
Copy link
Member

I think this LGTM - can we fix the CI failures? Once we do that I'll give it a spin on a 4k disk just to verify it works (I know it won't ever get run against a 4k disk, but in theory it should just work).

@lukewarmtemp
Copy link
Contributor Author

can we fix the CI failures

Not really sure why it's failing... I used truncate -s -1 to get rid of the whitespace at the end of the file.

@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch from f920948 to 4fea8d1 Compare November 28, 2023 22:20
dustymabe added a commit to coreos/coreos-assembler that referenced this pull request Nov 28, 2023
This will make the partitions get a partition label, which we rely
on. See coreos/fedora-coreos-config#2704 (comment)
@dustymabe
Copy link
Member

let's squash this into one commit?

Create a test to verify partition numbers and sizes. This is to ensure
that the partition scheme is what we expect during the transition to using
OSBuild in the FCOS pipeline.
@lukewarmtemp lukewarmtemp force-pushed the add-partition-scheme-test branch from 4fea8d1 to 413c7c6 Compare November 29, 2023 19:17
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@dustymabe dustymabe merged commit 08b1380 into coreos:testing-devel Nov 29, 2023
3 checks passed
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.

2 participants