Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: action:raw "offset" field, both bytes and sector #335

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added tests/action-raw-offset/overlays/test/test-blk.raw
Binary file not shown.
42 changes: 42 additions & 0 deletions tests/action-raw-offset/test.yaml
Original file line number Diff line number Diff line change
@@ -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;