diff options
| author | Lubomir Rintel <lkundrak@v3.sk> | 2023-04-17 07:10:06 +0200 |
|---|---|---|
| committer | Thomas Haller <thaller@redhat.com> | 2023-05-11 14:22:21 +0200 |
| commit | 332b9c2a6a36e63674b45cfb323392f6f9e0d12b (patch) | |
| tree | 3f0066ce19392ed16449be20230a719babe6e916 /tools/test-cloud-meta-mock.py | |
| parent | 33288c03ea475909a5dedacb31d8b1dc2b48aa4b (diff) | |
| download | NetworkManager-332b9c2a6a36e63674b45cfb323392f6f9e0d12b.tar.gz | |
test/cloud-meta-mock: mock GCP metadata API
Not used for testing, but still might be useful for development.
Diffstat (limited to 'tools/test-cloud-meta-mock.py')
| -rwxr-xr-x | tools/test-cloud-meta-mock.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/test-cloud-meta-mock.py b/tools/test-cloud-meta-mock.py index 387b7544f6..ab3630addf 100755 --- a/tools/test-cloud-meta-mock.py +++ b/tools/test-cloud-meta-mock.py @@ -92,6 +92,9 @@ def default_resources(): azure_iface = azure_meta + b"/network/interface/" azure_query = b"?format=text&api-version=2017-04-02" + gcp_meta = b"/computeMetadata/v1/instance/" + gcp_iface = gcp_meta + b"network-interfaces/" + mac1 = b"9e:c0:3e:92:24:2d" mac2 = b"53:e9:7e:52:8d:a8" @@ -129,6 +132,14 @@ def default_resources(): azure_iface + b"1/ipv4/subnet/0/address/" + azure_query: b"172.31.166.0", azure_iface + b"0/ipv4/subnet/0/prefix/" + azure_query: b"20", azure_iface + b"1/ipv4/subnet/0/prefix/" + azure_query: b"20", + gcp_meta + b"id": b"", + gcp_iface: b"0\n1\n", + gcp_iface + b"0/mac": mac1, + gcp_iface + b"1/mac": mac2, + gcp_iface + b"0/forwarded-ips/": b"0\n", + gcp_iface + b"0/forwarded-ips/0": ip1, + gcp_iface + b"1/forwarded-ips/": b"0\n", + gcp_iface + b"1/forwarded-ips/0": ip2, } |
