Added integration tests for ephemeral nodes

Fetch the machines from headscale
This commit is contained in:
Juan Font 2022-12-27 19:05:21 +00:00
parent afae1ff7b6
commit 55a3885614
5 changed files with 120 additions and 8 deletions

View file

@ -316,6 +316,8 @@ func (t *HeadscaleInContainer) CreateNamespace(
func (t *HeadscaleInContainer) CreateAuthKey(
namespace string,
reusable bool,
ephemeral bool,
) (*v1.PreAuthKey, error) {
command := []string{
"headscale",
@ -323,13 +325,20 @@ func (t *HeadscaleInContainer) CreateAuthKey(
namespace,
"preauthkeys",
"create",
"--reusable",
"--expiration",
"24h",
"--output",
"json",
}
if reusable {
command = append(command, "--reusable")
}
if ephemeral {
command = append(command, "--ephemeral")
}
result, _, err := dockertestutil.ExecuteCommand(
t.container,
command,