Browse Source

Fix go vet and merge issues

Rod Hynes 4 months ago
parent
commit
7508fbe325

+ 9 - 4
psiphon/common/dsl/dsl_test.go

@@ -115,8 +115,14 @@ func TestDSLs(t *testing.T) {
 
 var (
 	testClientIP        = "192.168.0.1"
-	testClientGeoIPData = common.GeoIPData{"Country", "City", "ISP", "ASN", "ASO"}
-	testHostID          = "host_id"
+	testClientGeoIPData = common.GeoIPData{
+		Country: "Country",
+		City:    "City",
+		ISP:     "ISP",
+		ASN:     "ASN",
+		ASO:     "ASO",
+	}
+	testHostID = "host_id"
 )
 
 func testDSLs(testConfig *testConfig) error {
@@ -164,8 +170,7 @@ func testDSLs(testConfig *testConfig) error {
 	if testConfig.cacheServerEntries {
 		expectValidMetric = true
 		metricsValidator = func(metric string, fields common.LogFields) bool {
-			return metric == "dsl" &&
-				fields["dsl_event"].(string) == "get-server-entries"
+			return metric == "dsl_relay_get_server_entries"
 		}
 	}
 

+ 2 - 2
psiphon/common/inproxy/inproxy_test.go

@@ -439,9 +439,9 @@ func runTestInproxy(doMustUpgrade bool) error {
 
 	makeHandleTacticsPayload := func(
 		proxyPrivateKey SessionPrivateKey,
-		tacticsNetworkID string) func(_ string, _ []byte) bool {
+		tacticsNetworkID string) func(_ string, _ bool, _ []byte) bool {
 
-		return func(networkID string, tacticsPayload []byte) bool {
+		return func(networkID string, _ bool, tacticsPayload []byte) bool {
 			pendingProxyTacticsCallbacksMutex.Lock()
 			defer pendingProxyTacticsCallbacksMutex.Unlock()
 

+ 8 - 0
psiphon/common/tactics/tactics_test.go

@@ -156,6 +156,8 @@ func TestTactics(t *testing.T) {
 
 	expectedApplyCount := 3
 
+	compressTacticsEnabled := true
+
 	tacticsConfig := fmt.Sprintf(
 		tacticsConfigTemplate,
 		encodedRequestPublicKey,
@@ -381,6 +383,7 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
+		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -457,6 +460,7 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
+		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -539,6 +543,7 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
+		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -672,6 +677,7 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
+		compressTacticsEnabled,
 		apiParams2,
 		endPointProtocol,
 		endPointRegion,
@@ -742,6 +748,7 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
+		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -757,6 +764,7 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
+		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,

+ 1 - 1
psiphon/server/protobufConverter.go

@@ -62,7 +62,7 @@ var protobufMessageFieldGroups = map[string]protobufFieldGroupConfig{
 		baseParams: true,
 	},
 	"dsl_relay_get_server_entries": {
-		BaseParams: true,
+		baseParams: true,
 	},
 }