mirror of
https://github.com/outbackdingo/debos.git
synced 2026-01-27 10:18:47 +00:00
tests: add test for msdos partitioning
Add a test for partitioning an msdos label with more then 4 partitions. The expectation is that the 4th partition will be an extended partition in this case.
This commit is contained in:
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@@ -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" }
|
||||
|
||||
57
tests/msdos/expected.json
Normal file
57
tests/msdos/expected.json
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
56
tests/msdos/test.yaml
Normal file
56
tests/msdos/test.yaml
Normal file
@@ -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)'
|
||||
Reference in New Issue
Block a user