(t *testing.T)
| 46 | ) |
| 47 | |
| 48 | func TestDERPOnly(t *testing.T) { |
| 49 | t.Parallel() |
| 50 | |
| 51 | deploymentValues := coderdtest.DeploymentValues(t) |
| 52 | deploymentValues.Experiments = []string{ |
| 53 | "*", |
| 54 | } |
| 55 | |
| 56 | client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{ |
| 57 | Options: &coderdtest.Options{ |
| 58 | DeploymentValues: deploymentValues, |
| 59 | AppHostname: "*.primary.test.coder.com", |
| 60 | IncludeProvisionerDaemon: true, |
| 61 | RealIPConfig: &httpmw.RealIPConfig{ |
| 62 | TrustedOrigins: []*net.IPNet{{ |
| 63 | IP: net.ParseIP("127.0.0.1"), |
| 64 | Mask: net.CIDRMask(8, 32), |
| 65 | }}, |
| 66 | TrustedHeaders: []string{ |
| 67 | "CF-Connecting-IP", |
| 68 | }, |
| 69 | }, |
| 70 | }, |
| 71 | LicenseOptions: &coderdenttest.LicenseOptions{ |
| 72 | Features: license.Features{ |
| 73 | codersdk.FeatureWorkspaceProxy: 1, |
| 74 | codersdk.FeatureMultipleOrganizations: 1, |
| 75 | }, |
| 76 | }, |
| 77 | }) |
| 78 | t.Cleanup(func() { |
| 79 | _ = closer.Close() |
| 80 | }) |
| 81 | |
| 82 | // Create an external proxy. |
| 83 | _ = coderdenttest.NewWorkspaceProxyReplica(t, api, client, &coderdenttest.ProxyOptions{ |
| 84 | Name: "best-proxy", |
| 85 | DerpOnly: true, |
| 86 | }) |
| 87 | |
| 88 | // Should not show up in the regions list. |
| 89 | ctx := testutil.Context(t, testutil.WaitLong) |
| 90 | regions, err := client.Regions(ctx) |
| 91 | require.NoError(t, err) |
| 92 | require.Len(t, regions, 1) |
| 93 | require.Equal(t, api.Options.AccessURL.String(), regions[0].PathAppURL) |
| 94 | } |
| 95 | |
| 96 | func TestDERP(t *testing.T) { |
| 97 | t.Parallel() |
nothing calls this directly
no test coverage detected