control/controlclient: delete old naclbox code, require ts2021 Noise

Updates #11585
Updates tailscale/corp#18882

Change-Id: I90e2e4a211c58d429e2b128604614dde18986442
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-04-01 21:23:27 -07:00
committed by Brad Fitzpatrick
parent b9611461e5
commit 2409661a0d
3 changed files with 119 additions and 207 deletions

View File

@ -562,16 +562,11 @@ func TestAddPingRequest(t *testing.T) {
func TestC2NPingRequest(t *testing.T) {
tstest.Shard(t)
tstest.Parallel(t)
env := newTestEnv(t)
n1 := newTestNode(t, env)
n1.StartDaemon()
n1.AwaitListening()
n1.MustUp()
n1.AwaitRunning()
env := newTestEnv(t)
gotPing := make(chan bool, 1)
waitPing := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
env.Control.HandleC2N = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
t.Errorf("unexpected ping method %q", r.Method)
}
@ -584,8 +579,14 @@ func TestC2NPingRequest(t *testing.T) {
t.Errorf("body error\n got: %q\nwant: %q", got, want)
}
gotPing <- true
}))
defer waitPing.Close()
})
n1 := newTestNode(t, env)
n1.StartDaemon()
n1.AwaitListening()
n1.MustUp()
n1.AwaitRunning()
nodes := env.Control.AllNodes()
if len(nodes) != 1 {
@ -604,7 +605,7 @@ func TestC2NPingRequest(t *testing.T) {
cancel()
pr := &tailcfg.PingRequest{
URL: fmt.Sprintf("%s/ping-%d", waitPing.URL, try),
URL: fmt.Sprintf("https://unused/some-c2n-path/ping-%d", try),
Log: true,
Types: "c2n",
Payload: []byte("POST /echo HTTP/1.0\r\nContent-Length: 3\r\n\r\nabc"),