diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0d9cde..de1e1c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -128,9 +128,13 @@ jobs: - { name: "debian (amd64)", case: "debian", variables: "-t architecture:amd64" } - { name: "debian (arm64)", case: "debian", variables: "-t architecture:arm64" } - { name: "debian (armhf)", case: "debian", variables: "-t architecture:armhf" } + - { name: "partitioning", case: "partitioning" } + - { name: "msdos partitioning", case: "msdos" } exclude: - backend: nofakemachine test: { name: "partitioning", case: "partitioning" } + - backend: nofakemachine + test: { name: "msdos partitioning", case: "msdos" } include: - backend: kvm test: { name: "arch", case: "arch" } diff --git a/tests/msdos/expected.json b/tests/msdos/expected.json new file mode 100644 index 0000000..3e143f3 --- /dev/null +++ b/tests/msdos/expected.json @@ -0,0 +1,57 @@ +{ + "partitiontable": { + "label": "dos", + "id": "0xdeadbeef", + "device": "test.img", + "unit": "sectors", + "sectorsize": 512, + "partitions": [ + { + "node": "test.img1", + "start": 1, + "size": 500000, + "type": "83" + },{ + "node": "test.img2", + "start": 500001, + "size": 3406250, + "type": "83" + },{ + "node": "test.img3", + "start": 3906251, + "size": 1953125, + "type": "83" + },{ + "node": "test.img4", + "start": 5859376, + "size": 9765624, + "type": "f" + },{ + "node": "test.img5", + "start": 5859377, + "size": 1953124, + "type": "83" + },{ + "node": "test.img6", + "start": 7812502, + "size": 1953124, + "type": "83" + },{ + "node": "test.img7", + "start": 9765627, + "size": 1953124, + "type": "83" + },{ + "node": "test.img8", + "start": 11718752, + "size": 1953124, + "type": "83" + },{ + "node": "test.img9", + "start": 13671877, + "size": 1953123, + "type": "83" + } + ] + } +} diff --git a/tests/msdos/test.yaml b/tests/msdos/test.yaml new file mode 100644 index 0000000..a321e10 --- /dev/null +++ b/tests/msdos/test.yaml @@ -0,0 +1,56 @@ +architecture: amd64 + +actions: + - action: image-partition + description: Partition the image + imagename: test.img + imagesize: 8G + partitiontype: msdos + diskid: deadbeef + mountpoints: + - mounpoint: / + partition: system + partitions: + - name: boot + fs: ext2 + start: 0% + end: 256M + - name: system + fs: ext4 + start: 256m + end: 2G + - name: data0 + fs: ext4 + start: 2G + end: 3G + - name: data1 + fs: ext4 + start: 3G + end: 4G + - name: data2 + fs: ext4 + start: 4G + end: 5G + - name: data3 + fs: ext4 + start: 5G + end: 6G + - name: data4 + fs: ext4 + start: 6G + end: 7G + - name: data5 + fs: ext4 + start: 7G + end: 8G + + - action: run + chroot: false + command: > + cd ${ARTIFACTDIR}; + sfdisk -J test.img | tee ${RECIPEDIR}/actual.json + + - action: run + description: Compare expected and actual + chroot: false + command: bash -c 'diff -u <(jq . ${RECIPEDIR}/expected.json) <(jq . ${RECIPEDIR}/actual.json)'