use userdata only to seed ami bootstrap env
This commit is contained in:
parent
3be933f16b
commit
a7aabdff51
3 changed files with 30 additions and 56 deletions
|
|
@ -0,0 +1,18 @@
|
|||
"""Unit tests for builder bootstrap user-data rendering."""
|
||||
|
||||
from nix_builder_autoscaler.bootstrap.userdata import render_userdata
|
||||
|
||||
|
||||
def test_render_userdata_writes_bootstrap_env_inputs() -> None:
|
||||
script = render_userdata("slot001", ssm_param="/nix-builder/ts-authkey")
|
||||
assert "cat > /etc/nix-builder-bootstrap-env <<EOF" in script
|
||||
assert 'SLOT_ID="$SLOT_ID"' in script
|
||||
assert 'TS_SSM_PARAM="$SSM_PARAM"' in script
|
||||
assert "chmod 600 /etc/nix-builder-bootstrap-env" in script
|
||||
|
||||
|
||||
def test_render_userdata_does_not_inline_tailscale_setup() -> None:
|
||||
script = render_userdata("slot001", ssm_param="/nix-builder/ts-authkey")
|
||||
assert "aws ssm get-parameter" not in script
|
||||
assert "/etc/tailscale/autoconnect.conf" not in script
|
||||
assert "TS_EXTRA_ARGS=" not in script
|
||||
Loading…
Add table
Add a link
Reference in a new issue