1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-15 11:22:43 +03:00

10 Commits

Author SHA1 Message Date
Natanael Copa
e51051c7ca tests: refactor fake userdata for nocloud
- move it so it can be shared
- remove mentions of #cloud-config to avoid confusion
2023-04-06 22:07:58 +02:00
Natanael Copa
7ea8f69a06 Fix user-data decompression on all shells
yash[1] and zsh does not handle 8-bit bytes in strings good. Work around it
by using printf ... | cmp ... to compare the header. This should be 100%
posix compatible.

Also fix some of the compression header magic bytes:

- unxz: Use octal aas the string '\3757zXZ\000' was misinterpreted by some
  shells.
- lzma: the third byte represents compression mode[2], and we want
  support all compression modes not only '8', so we only check the first
  three bytes instead of 4.

[1]: Upstream report: https://osdn.net/projects/yash/ticket/47772
[2]: https://github.com/frizb/FirmwareReverseEngineering/blob/master/IdentifyingCompressionAlgorithms.md#lzma
2023-04-06 17:19:40 +02:00
Natanael Copa
ab46d7223f tests: add test for save_userdata
Test that compressed user-data gets properly detected
2023-04-06 17:19:40 +02:00
Natanael Copa
a67cbd37b0 Add test for ssh-keys in nocloud yaml 2023-04-06 17:19:40 +02:00
Natanael Copa
0f53f14399 tests: add initial tests for init-main 2023-04-06 17:19:36 +02:00
Natanael Copa
38cbdee6a2 Return failure if any of install_modules fails
Add test to verify that install_modules can be skipped and that
install_modules returns failure if it fails to update mdev.conf.
2023-03-09 11:47:34 +01:00
Natanael Copa
091af053c5 Use printf for skip_action
printf is posix compatible and works with all shell. echo -n does not
work with yash and is not posix compatible.

Add test for skipping expand_root
2023-03-09 11:47:34 +01:00
Natanael Copa
a626e694c6 Refactor expand_root
Simplify it a bit.
- use awk /proc/mounts instead of busybox mountpoint
- use sysfs to find partition and volume. This is more robust
- add tests for it
2023-03-09 11:47:34 +01:00
Natanael Copa
b9156a7f43 Add tests for imds aws 2023-03-09 02:22:11 +00:00
Natanael Copa
c335944911 Add kyua testsuite and make code more portable 2023-03-08 03:39:39 +00:00