1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-14 19:02:45 +03:00

103 Commits

Author SHA1 Message Date
Natanael Copa
85108e958b Fix vim modelines and make more readable
Add missing trailing :

Use filetype=sh instead of ft=sh to make it more readable.
3.0.0_rc6
2023-05-24 14:50:02 +00:00
Natanael Copa
b4776260db Move create_default_user to main phase 2023-05-23 14:28:23 +00:00
Natanael Copa
a042bf8cf1 Consolidate init-*.test into init.test
The separate init-early, init-main and init-final were consolidated in
commit 81869cefccd3 (Consolidate init functionality in /sbin/tiny-cloud)

Do the same with the unit tests for those functions.

No functional changes.
2023-05-22 12:15:57 +02:00
Natanael Copa
3ca6b74a48 Hide mount failures when looking for CIDATA
fixes https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/issues/43
2023-05-22 09:49:23 +00:00
Natanael Copa
40d15db038 Use fake getent to avoid existing system users
The default user may or may not exist on the system running the tests.
Create a fake getent to simulate non-existing user in a consistent way.

fixes https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/issues/42
2023-05-22 11:27:56 +02:00
Jake Buchholz Göktürk
5f26d1f579 Rename Phases & Support doas.conf 2023-05-22 00:34:28 +00:00
Jake Buchholz Göktürk
69733fbedd update tiny-cloud --help slightly and otherwise mostly tab/space adjustments 2023-05-21 14:22:08 -07:00
Natanael Copa
c4195b5e8b Add package_update / package_upgrade
Allows system to be upgraded before installing new.

ref: https://cloudinit.readthedocs.io/en/latest/reference/modules.html#package-update-upgrade-install
2023-05-19 17:50:33 +02:00
Natanael Copa
3837da9471 Re-order functions
Move write_data up below bootcmd, so it is in the order it will execute.

No functional changes
2023-05-19 11:15:02 +02:00
Natanael Copa
000f41a48b Add .editorconfig and replace spaces with tabs 2023-05-19 04:13:16 +00:00
Jussi Nummelin
7d9a280a67 Add support for write_files instructions 2023-05-18 13:31:11 +00:00
Natanael Copa
b63ffb71d0 Refactor imds tests and add tests for azure, gcp and oci 2023-05-18 13:25:27 +00:00
Natanael Copa
0f40c146f2 Refactor aws tests' fake meta-data
Refactor fake wget to use a yaml so we can set aws fake meta-data
similar to how we set nocloud fake meta-data.

Also move fake netcat to tests/bin/nc so its always there and we don't
need to remember to call fake_netcat when needed.
2023-05-17 17:40:43 +00:00
Natanael Copa
a90bf444d3 Unhide imds error messages
imds drivers may print error messages to stderr. Do not hide those.
2023-05-17 14:36:09 +02:00
Natanael Copa
c4d2592e41 Do not show missing user error if there is no ssh-key provided
fixes https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/issues/41
2023-05-16 20:52:13 +00:00
Natanael Copa
fd24be8d96 nocloud: create temp mount dir under /run
The /run is usually a tmpfs which is automatically removed on reboot.
Use this for the temp mount dir so we don't leave any /mnt/cidata-* temp
leftovers.

Also explicitly create the parent directory of the temp dir, which may
no exist.  This solved a weird case where running tests locally ended up
hanging in mount.
2023-05-16 20:47:33 +00:00
Natanael Copa
7745fb6fcc make: run tests in parallel
Speed up the test run by running them in parallel
2023-05-16 16:55:35 +02:00
Jake Buchholz Göktürk
badf0f65d1 Fix UserData Script chmod, etc. 2023-05-15 01:33:57 +00:00
Jake Buchholz Göktürk
e650415799 fix makefile again 3.0.0_rc5 2023-05-13 16:16:44 -07:00
Jake Buchholz Göktürk
4df28f79a6 fix broken Makefile 2023-05-13 16:02:07 -07:00
Jake Buchholz Göktürk
bc6edeeaa5 install user-data handlers, tweak logging 2023-05-13 22:05:58 +00:00
Jake Buchholz Göktürk
13b0eef9fe Add "net" phase to tiny-cloud --setup 3.0.0_rc4 3.0.0_rc3 2023-05-10 19:24:31 +00:00
Jake Buchholz Göktürk
fa3125f0a5 Fix OpenRC Dependencies 2023-05-10 18:16:14 +00:00
Natanael Copa
b03030182f Add cloud provider "alpine" and user-data "alpine-conf" 3.0.0_rc2 2023-05-09 14:15:31 +00:00
Jake Buchholz Göktürk
17d0b3d07b stderr output for set_ssh_keys failure 2023-05-09 04:16:15 +00:00
Jake Buchholz Göktürk
229fc70b42 add STDERR output for problems with set_hostname 2023-05-09 04:13:21 +00:00
Natanael Copa
de66c6049e Handle error when setting ssh key
Avoid create a /.ssh dir if user does not exist.
2023-05-08 22:31:58 +02:00
Natanael Copa
7be3b198fb Avoid set empty hostname
Avaoid situation where we end up with an empty /etc/hostname.
2023-05-08 22:31:58 +02: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
0500f71837 Don't print error on missing /proc/mounts
This is useful for testing
2023-05-08 13:48:29 +02:00
Natanael Copa
dd7cb23515 Make it posible to override the init actions
This makes it easier to run parts of the actions when running tests.
2023-05-08 13:45:58 +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
a7600fb5ff Only try to expand root which is ext4
Root filesystem may be tmpfs or something else, in which case we should
not call resize2fs.
2023-05-05 03:41:55 +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
7ad4565a04 update changelog 3.0.0_rc1 2023-05-02 19:16:17 -07: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" 3.0.0_rc0 2023-04-30 23:23:54 +00:00
Jake Buchholz Göktürk
fb2d658d93 Move cloud libs deeper. 2023-04-30 14:55:51 -07:00
Jake Buchholz Göktürk
81869cefcc Consolidate init functionality in /sbin/tiny-cloud 2023-04-30 03:37:11 +00:00
Jake Buchholz Göktürk
762fe36bb8 Move OpenRC Init Scripts 2023-04-29 14:14:20 -07:00
Jake Buchholz Göktürk
83e8677481 Move Tiny Cloud configs into /etc 2023-04-29 20:54:45 +00:00
Jake Buchholz Göktürk
cdae70909c document the deprecation of ebs-nvme-symlinks 2023-04-29 20:30:43 +00:00
Natanael Copa
43bedda17f Adjust when tiny-cloud-early should start 2023-04-14 21:21:07 +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