feat(integration-vm): cloud-init user-data/meta-data rendering
This commit is contained in:
parent
b5d5dffeaf
commit
6f53d00b71
1 changed files with 13 additions and 0 deletions
|
|
@ -30,3 +30,16 @@ def test_parse_lease_ip_extracts_ipv4():
|
|||
|
||||
def test_parse_lease_ip_none_when_absent():
|
||||
assert ivm.parse_lease_ip("no leases\n") is None
|
||||
|
||||
|
||||
def test_meta_data_has_instance_and_hostname():
|
||||
md = ivm.render_meta_data("iid-askari-x", "boma-it-askari-x")
|
||||
assert "instance-id: iid-askari-x" in md
|
||||
assert "local-hostname: boma-it-askari-x" in md
|
||||
|
||||
def test_user_data_injects_key_and_ansible_user():
|
||||
ud = ivm.render_user_data("ssh-ed25519 AAAA... claude@ubongo", "ansible")
|
||||
assert ud.startswith("#cloud-config")
|
||||
assert "name: ansible" in ud
|
||||
assert "ssh-ed25519 AAAA... claude@ubongo" in ud
|
||||
assert "NOPASSWD:ALL" in ud
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue