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

74 Commits

Author SHA1 Message Date
Jake Buchholz Göktürk
badf0f65d1 Fix UserData Script chmod, etc. 2023-05-15 01:33:57 +00:00
Jake Buchholz Göktürk
bc6edeeaa5 install user-data handlers, tweak logging 2023-05-13 22:05:58 +00:00
Natanael Copa
b03030182f Add cloud provider "alpine" and user-data "alpine-conf" 2023-05-09 14:15:31 +00:00
Natanael Copa
468407db05 Add test for empty or no config
for all providers
2023-05-08 22:31:58 +02:00
Natanael Copa
f46b6b24d8 tests: unify fake_metadata_nocloud and fake_userdata_nocloud
Avoid duplication of code.

No changes in behavior
2023-05-08 16:54:52 +02:00
Natanael Copa
d1ed0c29e3 Make init__create_default_user return success
We should return success even if /etc/doas.d is missing
fixes https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/issues/38
2023-05-08 12:19:11 +02:00
Jake Buchholz Göktürk
4ccc16f18f Enable sshd & Source UserData Handler 2023-05-08 04:41:41 +00:00
Jake Buchholz Göktürk
4f9386bb94 Add "create_default_user" Init Action 2023-05-08 02:37:54 +00:00
Jake Buchholz Göktürk
ec139644a1 Set Default interfaces 2023-05-07 23:49:50 +00:00
Natanael Copa
02c0c31703 tiny-cloud: Print usage on invalid option and add test
Add test that verifies invalid option and `tiny-cloud --help`
2023-05-04 11:50:22 +02:00
Jake Buchholz Göktürk
58ac2108cd Fixes for tiny-cloud Wrapper
* switch from phase functions to variables containing list of actions
* init actions prefixed with 'init__'
* refine output during init
* add syslog entries
* add --setup for putting init scripts in the right runlevel
2023-05-03 02:11:01 +00:00
Jake Buchholz Göktürk
3894cd9f8d Support "local-hostname" 2023-04-30 23:23:54 +00:00
Jake Buchholz Göktürk
81869cefcc Consolidate init functionality in /sbin/tiny-cloud 2023-04-30 03:37:11 +00:00
Natanael Copa
fa01b4ea9a tests: add tests for init-final 2023-04-06 22:27:42 +02:00
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