diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fb43f92..397b7e2b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -137,6 +137,10 @@ jobs: test: { name: "apertis", case: "apertis" } - backend: { name: "uml", backend: "--fakemachine-backend=uml" } test: { name: "partitioning", case: "partitioning" } + - backend: { name: "qemu", backend: "--fakemachine-backend=qemu" } + test: { name: "action-raw-offset", case: "action-raw-offset" } + - backend: { name: "uml", backend: "--fakemachine-backend=uml" } + test: { name: "action-raw-offset", case: "action-raw-offset" } name: ${{matrix.test.name}} on ${{matrix.backend.name}} steps: - name: Repository checkout diff --git a/tests/action-raw-offset/overlays/test/test-blk.raw b/tests/action-raw-offset/overlays/test/test-blk.raw new file mode 100644 index 00000000..20e6c3c7 Binary files /dev/null and b/tests/action-raw-offset/overlays/test/test-blk.raw differ diff --git a/tests/action-raw-offset/test.yaml b/tests/action-raw-offset/test.yaml new file mode 100644 index 00000000..97260807 --- /dev/null +++ b/tests/action-raw-offset/test.yaml @@ -0,0 +1,42 @@ +{{- $sector1 := 80 -}} +{{- $offset1 := 40960 -}} +{{- $sector2 := 82 -}} + +{{- $image_test := "test.img" -}} +{{- $sample := "overlays/test/test-blk.raw" -}} + +architecture: arm64 + +actions: + - action: overlay + description: Deploy test block + source: overlays/test + + - action: image-partition + description: Create {{ $image_test }} + imagename: {{ $image_test }} + imagesize: {{ sector 128 }} + partitiontype: msdos + + - action: raw + description: Writing by bytes to {{ $image_test }}, offset {{ $offset1 }} + origin: filesystem + source: /test-blk.raw + offset: {{ $offset1 }} + + - action: raw + description: Writing by sector to {{ $image_test }}, offset {{ sector $sector2 }}, sector {{ $sector2 }} + origin: filesystem + source: /test-blk.raw + offset: {{ sector $sector2 }} + + - action: run + description: Run the test against the result image + chroot: false + postprocess: true + command: > + cd ${ARTIFACTDIR}; + dd if={{ $image_test }} of=raw.byte bs=512 skip={{ $sector1 }} count=1 status=none; + dd if={{ $image_test }} of=raw.sector bs=512 skip={{ $sector2 }} count=1 status=none; + diff -s ${RECIPEDIR}/{{ $sample }} raw.byte || exit 1; + diff -s ${RECIPEDIR}/{{ $sample }} raw.sector || exit 2;