From 7cf25765ff1f73072a76451e09413c72653e6e64 Mon Sep 17 00:00:00 2001 From: Vladimir Shakhov Date: Thu, 5 May 2022 13:16:04 +0200 Subject: [PATCH] Test for action:raw "offset", both bytes and sector --- .github/workflows/ci.yaml | 4 ++ .../overlays/test/test-blk.raw | Bin 0 -> 512 bytes tests/action-raw-offset/test.yaml | 42 ++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 tests/action-raw-offset/overlays/test/test-blk.raw create mode 100644 tests/action-raw-offset/test.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3f06c7e2..92a3b6fa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -100,6 +100,10 @@ jobs: test: { name: "partitioning", case: "partitioning" } - 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 0000000000000000000000000000000000000000..20e6c3c74a388a1661e1fd5091b056dd68e39ccc GIT binary patch literal 512 zcmV+b0{{KqfqK?IJL{WZ9L|K>&R7*o9z1Z2DTuO-&lZrF!_ugV;hOlkZNyOSX}(RE zwSC>v))J&U=f&;5IrrfWQvY5by9tvFef}!Cgqf0n<40wAr_lEIHV=yolP>31b{71~ zK;v+{jg2$&)L*?WfLuEZz00V$uqhb=%wmd6bH^K(5n~{6@*8vKpi`=}lTyVV-Zz{> z*nUNDHF+ZS0yv)wbF8$v|5>k}$bjzc_dhcQUx^GGcwwTjjR=IWGA*Zjzt=**Y3DrE zY!#Qm{ZK)lLQ?R?88tRig_deKdtZRCD+7sS;BzVsFzx7Wyr{|mGiFuuC$7wqyip0Q zL<%a}JJ3@hf(g~x;HgHMr!T(r*lZ>})NNVv)sC-9oe`4V0PH$QWA}eN-rL z{L)v&*l;1sBT7Vl4M%wQLo*sIVr~g_0%Mz71P8={yK`Yes(GUwIDekXf5ZTSBOd%0 zKulM4DjBK16ISZ%6C*gH*HqR;6x{NlE1g8gs~|tK5?jgb8!7RHe+CthJeCZR+;w%L z+9ZT~+6b|97k@)P!C}=Yt{+W(N|1KOEcyZM^oX=bu$2Tyz=Id+K*>OU|+^ivqti@nGb;``-k=`XWdX< C0s8s? literal 0 HcmV?d00001 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;