|
66 | 66 |
|
67 | 67 | headscale users create --config ./config.yaml bob
|
68 | 68 | api_key="$(headscale apikeys create --config ./config.yaml)"
|
69 |
| - auth_key="$(headscale preauthkeys create --reusable -e 24h --config ./config.yaml -u bob)" |
| 69 | + auth_key="$(headscale preauthkeys create --reusable -e 100y --config ./config.yaml -u bob)" |
70 | 70 | cat >$out/apikey-envfile <<EOF
|
71 | 71 | TS_API_KEY=$api_key
|
72 | 72 | TS_BASE_URL=${config.server_url}
|
|
235 | 235 | def wait_for_hoopsnake_registered(name):
|
236 | 236 | "Poll until hoopsnake appears in the list of hosts, then return its IP."
|
237 | 237 | while True:
|
238 |
| - output = json.loads(headscale.succeed("headscale nodes list -o json-line")) |
239 |
| - print(output) |
240 |
| - basic_entry = [elt["ip_addresses"][0] for elt in output if elt["given_name"] == name] |
241 |
| - if len(basic_entry) == 1: |
242 |
| - return basic_entry[0] |
| 238 | + status = json.loads(bob.succeed("tailscale status --json --peers --self=false")) |
| 239 | + if status["Peer"] is not None: |
| 240 | + basic_entry = [elt["TailscaleIPs"][0] for _, elt in status["Peer"].items() if elt["HostName"] == name] |
| 241 | + if len(basic_entry) == 1: |
| 242 | + return basic_entry[0] |
243 | 243 | time.sleep(1)
|
244 | 244 |
|
245 | 245 |
|
|
319 | 319 | def wait_for_hoopsnake_registered(name):
|
320 | 320 | "Poll until hoopsnake appears in the list of hosts, then return its IP."
|
321 | 321 | while True:
|
322 |
| - output = json.loads(headscale.succeed("headscale nodes list -o json-line")) |
323 |
| - print(output) |
324 |
| - basic_entry = [elt["ip_addresses"][0] for elt in output if elt["given_name"] == name] |
325 |
| - if len(basic_entry) == 1: |
326 |
| - return basic_entry[0] |
| 322 | + status = json.loads(bob.succeed("tailscale status --json --peers --self=false")) |
| 323 | + if status["Peer"] is not None: |
| 324 | + basic_entry = [elt["TailscaleIPs"][0] for _, elt in status["Peer"].items() if elt["HostName"] == name] |
| 325 | + if len(basic_entry) == 1: |
| 326 | + return basic_entry[0] |
327 | 327 | time.sleep(1)
|
328 | 328 |
|
329 | 329 | with subtest("Test setup"):
|
|
0 commit comments