Add test for partitioning with alternate sector size

parted will return an error code if the partition
table is not found, and will print the message:
"unrecognised disk label"

Signed-off-by: Julien Massot <julien.massot@collabora.com>
This commit is contained in:
Julien Massot
2025-02-19 08:08:55 +01:00
committed by Sjoerd Simons
parent f0b70e0bac
commit 396bf430a1
2 changed files with 27 additions and 0 deletions

View File

@@ -176,6 +176,10 @@ jobs:
test: { name: "arch", case: "arch" }
- backend: kvm
test: { name: "apertis", case: "apertis" }
- backend: kvm
test: { name: "512 sector size GPT partition table", case: "partitioning-sector-size", variables: "-t sectorsize:512" }
- backend: kvm
test: { name: "4096 sector size GPT partition table", case: "partitioning-sector-size", variables: "-t sectorsize:4096" }
name: ${{matrix.test.name}} on ${{matrix.backend}}
runs-on: 'ubuntu-latest'
steps:

View File

@@ -0,0 +1,23 @@
{{ $sectorsize := or .sectorsize 512 }}
architecture: amd64
sectorsize: {{ $sectorsize }}
actions:
- action: image-partition
description: Create a {{ $sectorsize }} sector size image
imagename: test.img
imagesize: 10M
partitiontype: gpt
partitions:
- name: system
fs: ext4
start: 2m
end: 100%
#
# Would more elegant to check the sector size with
# sfdisk --sector-size {{ $sectorsize }} -J test.img | jq .partitiontable.sectorsize
# once we have an updated sfdisk that supports this option see:
# https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41-ReleaseNotes
- action: run
description: Print partition table
chroot: false
command: bash -c 'PARTED_SECTOR_SIZE={{ $sectorsize }} parted -s ${ARTIFACTDIR}/test.img print'