mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Corrected integration tests and github test-integration workflow
This commit is contained in:
		
							parent
							
								
									651212c201
								
							
						
					
					
						commit
						48c3bd8f55
					
				
							
								
								
									
										3
									
								
								.github/workflows/test-integration.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/test-integration.yaml
									
									
									
									
										vendored
									
									
								
							@ -23,10 +23,12 @@ jobs:
 | 
				
			|||||||
          - TestOIDCExpireNodesBasedOnTokenExpiry
 | 
					          - TestOIDCExpireNodesBasedOnTokenExpiry
 | 
				
			||||||
          - TestAuthWebFlowAuthenticationPingAll
 | 
					          - TestAuthWebFlowAuthenticationPingAll
 | 
				
			||||||
          - TestAuthWebFlowLogoutAndRelogin
 | 
					          - TestAuthWebFlowLogoutAndRelogin
 | 
				
			||||||
 | 
					          - TestAuthNodeApproval
 | 
				
			||||||
          - TestUserCommand
 | 
					          - TestUserCommand
 | 
				
			||||||
          - TestPreAuthKeyCommand
 | 
					          - TestPreAuthKeyCommand
 | 
				
			||||||
          - TestPreAuthKeyCommandWithoutExpiry
 | 
					          - TestPreAuthKeyCommandWithoutExpiry
 | 
				
			||||||
          - TestPreAuthKeyCommandReusableEphemeral
 | 
					          - TestPreAuthKeyCommandReusableEphemeral
 | 
				
			||||||
 | 
					          - TestPreAuthKeyCommandPreApproved
 | 
				
			||||||
          - TestPreAuthKeyCorrectUserLoggedInCommand
 | 
					          - TestPreAuthKeyCorrectUserLoggedInCommand
 | 
				
			||||||
          - TestApiKeyCommand
 | 
					          - TestApiKeyCommand
 | 
				
			||||||
          - TestNodeTagCommand
 | 
					          - TestNodeTagCommand
 | 
				
			||||||
@ -34,6 +36,7 @@ jobs:
 | 
				
			|||||||
          - TestNodeAdvertiseTagWithACLCommand
 | 
					          - TestNodeAdvertiseTagWithACLCommand
 | 
				
			||||||
          - TestNodeCommand
 | 
					          - TestNodeCommand
 | 
				
			||||||
          - TestNodeExpireCommand
 | 
					          - TestNodeExpireCommand
 | 
				
			||||||
 | 
					          - TestNodeApproveCommand
 | 
				
			||||||
          - TestNodeRenameCommand
 | 
					          - TestNodeRenameCommand
 | 
				
			||||||
          - TestNodeMoveCommand
 | 
					          - TestNodeMoveCommand
 | 
				
			||||||
          - TestPolicyCommand
 | 
					          - TestPolicyCommand
 | 
				
			||||||
 | 
				
			|||||||
@ -2,6 +2,7 @@ package integration
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"context"
 | 
						"context"
 | 
				
			||||||
 | 
						"crypto/tls"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
 | 
						v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
 | 
				
			||||||
	"github.com/juanfont/headscale/integration/hsic"
 | 
						"github.com/juanfont/headscale/integration/hsic"
 | 
				
			||||||
@ -39,6 +40,8 @@ func TestAuthNodeApproval(t *testing.T) {
 | 
				
			|||||||
	err = scenario.CreateHeadscaleEnv(
 | 
						err = scenario.CreateHeadscaleEnv(
 | 
				
			||||||
		spec,
 | 
							spec,
 | 
				
			||||||
		hsic.WithTestName("approval"),
 | 
							hsic.WithTestName("approval"),
 | 
				
			||||||
 | 
							hsic.WithTLS(),
 | 
				
			||||||
 | 
							hsic.WithHostnameAsServerURL(),
 | 
				
			||||||
		hsic.WithManualApproveNewNode(),
 | 
							hsic.WithManualApproveNewNode(),
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
	assertNoErrHeadscaleEnv(t, err)
 | 
						assertNoErrHeadscaleEnv(t, err)
 | 
				
			||||||
@ -236,7 +239,16 @@ func (s *AuthApprovalScenario) runHeadscaleRegister(userStr string, loginURL *ur
 | 
				
			|||||||
	loginURL.Host = fmt.Sprintf("%s:8080", headscale.GetIP())
 | 
						loginURL.Host = fmt.Sprintf("%s:8080", headscale.GetIP())
 | 
				
			||||||
	loginURL.Scheme = "http"
 | 
						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()
 | 
						ctx := context.Background()
 | 
				
			||||||
	req, _ := http.NewRequestWithContext(ctx, http.MethodGet, loginURL.String(), nil)
 | 
						req, _ := http.NewRequestWithContext(ctx, http.MethodGet, loginURL.String(), nil)
 | 
				
			||||||
	resp, err := httpClient.Do(req)
 | 
						resp, err := httpClient.Do(req)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user