mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-21 01:38:32 +00:00
feature/taildrop: add integration test variant with profiles that exist
Updates #15970 Updates #15812 Updates tailscale/corp#28449 Change-Id: I52cf25f98636b0beac16275f46e58d0816963895 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
abe04bfa78
commit
49a7685af9
@ -26,6 +26,21 @@ import (
|
|||||||
// TODO(bradfitz): add test between different users with the peercap to permit that?
|
// TODO(bradfitz): add test between different users with the peercap to permit that?
|
||||||
|
|
||||||
func TestTaildropIntegration(t *testing.T) {
|
func TestTaildropIntegration(t *testing.T) {
|
||||||
|
t.Skip("known failing test; see https://github.com/tailscale/tailscale/issues/15970")
|
||||||
|
testTaildropIntegration(t, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestTaildropIntegration_Fresh(t *testing.T) {
|
||||||
|
testTaildropIntegration(t, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// freshProfiles is whether to start the test right away
|
||||||
|
// with a fresh profile. If false, tailscaled is started, stopped,
|
||||||
|
// and restarted again to simulate a real-world scenario where
|
||||||
|
// the first profile already existed.
|
||||||
|
//
|
||||||
|
// This exercises an ipnext hook ordering issue we hit earlier.
|
||||||
|
func testTaildropIntegration(t *testing.T, freshProfiles bool) {
|
||||||
tstest.Parallel(t)
|
tstest.Parallel(t)
|
||||||
controlOpt := integration.ConfigureControl(func(s *testcontrol.Server) {
|
controlOpt := integration.ConfigureControl(func(s *testcontrol.Server) {
|
||||||
s.AllNodesSameUser = true // required for Taildrop
|
s.AllNodesSameUser = true // required for Taildrop
|
||||||
@ -39,18 +54,30 @@ func TestTaildropIntegration(t *testing.T) {
|
|||||||
n2 := integration.NewTestNode(t, env)
|
n2 := integration.NewTestNode(t, env)
|
||||||
d2 := n2.StartDaemon()
|
d2 := n2.StartDaemon()
|
||||||
|
|
||||||
n1.AwaitListening()
|
awaitUp := func() {
|
||||||
t.Logf("n1 is listening")
|
t.Helper()
|
||||||
n2.AwaitListening()
|
n1.AwaitListening()
|
||||||
t.Logf("n2 is listening")
|
t.Logf("n1 is listening")
|
||||||
n1.MustUp()
|
n2.AwaitListening()
|
||||||
t.Logf("n1 is up")
|
t.Logf("n2 is listening")
|
||||||
n2.MustUp()
|
n1.MustUp()
|
||||||
t.Logf("n2 is up")
|
t.Logf("n1 is up")
|
||||||
n1.AwaitRunning()
|
n2.MustUp()
|
||||||
t.Logf("n1 is running")
|
t.Logf("n2 is up")
|
||||||
n2.AwaitRunning()
|
n1.AwaitRunning()
|
||||||
t.Logf("n2 is running")
|
t.Logf("n1 is running")
|
||||||
|
n2.AwaitRunning()
|
||||||
|
t.Logf("n2 is running")
|
||||||
|
}
|
||||||
|
awaitUp()
|
||||||
|
|
||||||
|
if !freshProfiles {
|
||||||
|
d1.MustCleanShutdown(t)
|
||||||
|
d2.MustCleanShutdown(t)
|
||||||
|
d1 = n1.StartDaemon()
|
||||||
|
d2 = n2.StartDaemon()
|
||||||
|
awaitUp()
|
||||||
|
}
|
||||||
|
|
||||||
var peerStableID tailcfg.StableNodeID
|
var peerStableID tailcfg.StableNodeID
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user