1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-08-24 13:46:53 +02:00

Corrected integration tests and github test-integration workflow

This commit is contained in:
hopleus 2024-10-17 11:38:17 +03:00
parent 3aa93bc7f4
commit a9dbbd349a
2 changed files with 16 additions and 1 deletions

View File

@ -24,16 +24,19 @@ jobs:
- TestOIDC024UserCreation
- TestAuthWebFlowAuthenticationPingAll
- TestAuthWebFlowLogoutAndRelogin
- TestAuthNodeApproval
- TestUserCommand
- TestPreAuthKeyCommand
- TestPreAuthKeyCommandWithoutExpiry
- TestPreAuthKeyCommandReusableEphemeral
- TestPreAuthKeyCommandPreApproved
- TestPreAuthKeyCorrectUserLoggedInCommand
- TestApiKeyCommand
- TestNodeTagCommand
- TestNodeAdvertiseTagCommand
- TestNodeCommand
- TestNodeExpireCommand
- TestNodeApproveCommand
- TestNodeRenameCommand
- TestNodeMoveCommand
- TestPolicyCommand

View File

@ -2,6 +2,7 @@ package integration
import (
"context"
"crypto/tls"
"fmt"
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
"github.com/juanfont/headscale/integration/hsic"
@ -39,6 +40,8 @@ func TestAuthNodeApproval(t *testing.T) {
err = scenario.CreateHeadscaleEnv(
spec,
hsic.WithTestName("approval"),
hsic.WithTLS(),
hsic.WithHostnameAsServerURL(),
hsic.WithManualApproveNewNode(),
)
assertNoErrHeadscaleEnv(t, err)
@ -236,7 +239,16 @@ func (s *AuthApprovalScenario) runHeadscaleRegister(userStr string, loginURL *ur
loginURL.Host = fmt.Sprintf("%s:8080", headscale.GetIP())
loginURL.Scheme = "http"
httpClient := &http.Client{}
if len(headscale.GetCert()) > 0 {
loginURL.Scheme = "https"
}
insecureTransport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // nolint
}
httpClient := &http.Client{
Transport: insecureTransport,
}
ctx := context.Background()
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, loginURL.String(), nil)
resp, err := httpClient.Do(req)