diff --git a/tests/test_integration_vm.py b/tests/test_integration_vm.py index 2c8e107..c4df696 100644 --- a/tests/test_integration_vm.py +++ b/tests/test_integration_vm.py @@ -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