Skip to content

Commit 7cf2576

Browse files
author
Vladimir Shakhov
committed
Test for action:raw "offset", both bytes and sector
1 parent cb74f21 commit 7cf2576

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ jobs:
100100
test: { name: "partitioning", case: "partitioning" }
101101
- backend: { name: "uml", backend: "--fakemachine-backend=uml" }
102102
test: { name: "partitioning", case: "partitioning" }
103+
- backend: { name: "qemu", backend: "--fakemachine-backend=qemu" }
104+
test: { name: "action-raw-offset", case: "action-raw-offset" }
105+
- backend: { name: "uml", backend: "--fakemachine-backend=uml" }
106+
test: { name: "action-raw-offset", case: "action-raw-offset" }
103107
name: ${{matrix.test.name}} on ${{matrix.backend.name}}
104108
steps:
105109
- name: Repository checkout
512 Bytes
Binary file not shown.

tests/action-raw-offset/test.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{{- $sector1 := 80 -}}
2+
{{- $offset1 := 40960 -}}
3+
{{- $sector2 := 82 -}}
4+
5+
{{- $image_test := "test.img" -}}
6+
{{- $sample := "overlays/test/test-blk.raw" -}}
7+
8+
architecture: arm64
9+
10+
actions:
11+
- action: overlay
12+
description: Deploy test block
13+
source: overlays/test
14+
15+
- action: image-partition
16+
description: Create {{ $image_test }}
17+
imagename: {{ $image_test }}
18+
imagesize: {{ sector 128 }}
19+
partitiontype: msdos
20+
21+
- action: raw
22+
description: Writing by bytes to {{ $image_test }}, offset {{ $offset1 }}
23+
origin: filesystem
24+
source: /test-blk.raw
25+
offset: {{ $offset1 }}
26+
27+
- action: raw
28+
description: Writing by sector to {{ $image_test }}, offset {{ sector $sector2 }}, sector {{ $sector2 }}
29+
origin: filesystem
30+
source: /test-blk.raw
31+
offset: {{ sector $sector2 }}
32+
33+
- action: run
34+
description: Run the test against the result image
35+
chroot: false
36+
postprocess: true
37+
command: >
38+
cd ${ARTIFACTDIR};
39+
dd if={{ $image_test }} of=raw.byte bs=512 skip={{ $sector1 }} count=1 status=none;
40+
dd if={{ $image_test }} of=raw.sector bs=512 skip={{ $sector2 }} count=1 status=none;
41+
diff -s ${RECIPEDIR}/{{ $sample }} raw.byte || exit 1;
42+
diff -s ${RECIPEDIR}/{{ $sample }} raw.sector || exit 2;

0 commit comments

Comments
 (0)