mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-21 07:07:30 +00:00
Compare commits
10 Commits
web-auth-f
...
v0.17.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
89ff5c83d2 | ||
![]() |
0a47d694be | ||
![]() |
73c84d4f6a | ||
![]() |
a9251d6652 | ||
![]() |
f9c44f11d6 | ||
![]() |
1f8bd24a0d | ||
![]() |
7bf2eb3d71 | ||
![]() |
f5a5437917 | ||
![]() |
9989657c0f | ||
![]() |
cb2790984f |
@@ -1,35 +0,0 @@
|
|||||||
name: Integration Test v2
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
integration-test-v2:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Set Swap Space
|
|
||||||
uses: pierotofy/set-swap-space@master
|
|
||||||
with:
|
|
||||||
swap-size-gb: 10
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v14.1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
*.nix
|
|
||||||
go.*
|
|
||||||
**/*.go
|
|
||||||
integration_test/
|
|
||||||
config-example.yaml
|
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@v16
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
|
|
||||||
- name: Run general integration tests
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: nix develop --command -- make test_integration_v2_auth_web_flow
|
|
11
Makefile
11
Makefile
@@ -68,17 +68,6 @@ test_integration_v2_general:
|
|||||||
golang:1 \
|
golang:1 \
|
||||||
go test $(TAGS) -failfast ./... -timeout 60m -parallel 6
|
go test $(TAGS) -failfast ./... -timeout 60m -parallel 6
|
||||||
|
|
||||||
|
|
||||||
test_integration_v2_auth_web_flow:
|
|
||||||
docker run \
|
|
||||||
-t --rm \
|
|
||||||
-v ~/.cache/hs-integration-go:/go \
|
|
||||||
--name headscale-test-suite \
|
|
||||||
-v $$PWD:$$PWD -w $$PWD/integration \
|
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
||||||
golang:1 \
|
|
||||||
go test ./... -timeout 60m -parallel 6 -run TestAuthWebFlow
|
|
||||||
|
|
||||||
coverprofile_func:
|
coverprofile_func:
|
||||||
go tool cover -func=coverage.out
|
go tool cover -func=coverage.out
|
||||||
|
|
||||||
|
@@ -134,7 +134,9 @@ var registerNodeCmd = &cobra.Command{
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
SuccessOutput(response.Machine, fmt.Sprintf("Machine %s registered", response.Machine.GivenName), output)
|
SuccessOutput(
|
||||||
|
response.Machine,
|
||||||
|
fmt.Sprintf("Machine %s registered", response.Machine.GivenName), output)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -258,7 +258,13 @@ func (s *Scenario) RunTailscaleUp(
|
|||||||
// TODO(kradalby): error handle this
|
// TODO(kradalby): error handle this
|
||||||
_ = c.Up(loginServer, authKey)
|
_ = c.Up(loginServer, authKey)
|
||||||
}(client)
|
}(client)
|
||||||
|
|
||||||
|
err := client.WaitForReady()
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error waiting for client %s to be ready: %s", client.Hostname(), err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace.joinWaitGroup.Wait()
|
namespace.joinWaitGroup.Wait()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@@ -23,10 +23,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
errTailscalePingFailed = errors.New("ping failed")
|
errTailscalePingFailed = errors.New("ping failed")
|
||||||
errTailscaleNotLoggedIn = errors.New("tailscale not logged in")
|
errTailscaleNotLoggedIn = errors.New("tailscale not logged in")
|
||||||
errTailscaleWrongPeerCount = errors.New("wrong peer count")
|
errTailscaleWrongPeerCount = errors.New("wrong peer count")
|
||||||
errTailscaleNotConnected = errors.New("tailscale not connected")
|
errTailscaleCannotUpWithoutAuthkey = errors.New("cannot up without authkey")
|
||||||
|
errTailscaleNotConnected = errors.New("tailscale not connected")
|
||||||
)
|
)
|
||||||
|
|
||||||
type TailscaleInContainer struct {
|
type TailscaleInContainer struct {
|
||||||
@@ -170,7 +171,10 @@ func (t *TailscaleInContainer) UpWithLoginURL(
|
|||||||
t.hostname,
|
t.hostname,
|
||||||
}
|
}
|
||||||
|
|
||||||
_, stderr, _ := t.Execute(command)
|
_, stderr, err := t.Execute(command)
|
||||||
|
if errors.Is(err, errTailscaleNotLoggedIn) {
|
||||||
|
return nil, errTailscaleCannotUpWithoutAuthkey
|
||||||
|
}
|
||||||
|
|
||||||
urlStr := strings.ReplaceAll(stderr, "\nTo authenticate, visit:\n\n\t", "")
|
urlStr := strings.ReplaceAll(stderr, "\nTo authenticate, visit:\n\n\t", "")
|
||||||
urlStr = strings.TrimSpace(urlStr)
|
urlStr = strings.TrimSpace(urlStr)
|
||||||
|
Reference in New Issue
Block a user