From 77eafa579b05f856d1b9f3617babd1eb8d1daba2 Mon Sep 17 00:00:00 2001 From: kwadronaut <kwadronaut@autistici.org> Date: Thu, 17 Apr 2025 10:29:23 +0200 Subject: [PATCH] remove useage of demo.bitmask resolves !51 syntax fix syntax --- pkg/bootstrap/testdata/provider.json | 6 +++--- pkg/storage/storage_test.go | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/bootstrap/testdata/provider.json b/pkg/bootstrap/testdata/provider.json index bfb928d..747cd86 100644 --- a/pkg/bootstrap/testdata/provider.json +++ b/pkg/bootstrap/testdata/provider.json @@ -1,14 +1,14 @@ { - "api_uri":"https://api.demo.bitmask.net:4430", + "api_uri":"https://api.demo.example.org:4430", "api_version":"3", "ask_for_donations":true, "ca_cert_fingerprint":"SHA256: 40ed9d9c13872c1fcba25abdcf26a7b1bdeded433d74fbe1ccb58fbaaab58e23", - "ca_cert_uri":"https://demo.bitmask.net/ca.crt", + "ca_cert_uri":"https://demo.example.org/ca.crt", "default_language":"en", "description":{ "en":"non-prod testing provider" }, - "domain":"demo.bitmask.net", + "domain":"demo.example.org", "donate_url":"https://leap.se/donate", "donate_period":"7", "info_url":"https://leap.se", diff --git a/pkg/storage/storage_test.go b/pkg/storage/storage_test.go index 5b5a82c..32b4701 100644 --- a/pkg/storage/storage_test.go +++ b/pkg/storage/storage_test.go @@ -202,7 +202,7 @@ func TestNewBridge(t *testing.T) { storage.Close() }() - rawString := "{\"healthy\":true,\"host\":\"cod.demo.bitmask.net\",\"ip_addr\":\"37.218.245.94\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" + rawString := "{\"healthy\":true,\"host\":\"cod.example.org\",\"ip_addr\":\"1.2.3.4\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" err := storage.NewBridge("bridge1", "obfs4", "Paris", rawString) assert.Nil(t, err) bridges, err := storage.ListBridges() @@ -218,7 +218,7 @@ func TestNewBridge_RejectDuplicates(t *testing.T) { storage.Close() }() - rawString := "{\"healthy\":true,\"host\":\"cod.demo.bitmask.net\",\"ip_addr\":\"37.218.245.94\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" + rawString := "{\"healthy\":true,\"host\":\"cod.demo.example.org\",\"ip_addr\":\"1.2.3.4\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" err := storage.NewBridge("bridge1", "obfs4", "Paris", rawString) assert.Nil(t, err) // duplicated entry - name and raw string @@ -242,7 +242,7 @@ func TestGetBridgeByName(t *testing.T) { storage.Close() }() - rawString := "{\"healthy\":true,\"host\":\"cod.demo.bitmask.net\",\"ip_addr\":\"37.218.245.94\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" + rawString := "{\"healthy\":true,\"host\":\"cod.demo.example.org\",\"ip_addr\":\"1.2.3.4\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" _ = storage.NewBridge("bridge1", "obfs4", "Paris", rawString) _ = storage.NewBridge("bridge2", "obfs4", "Paris", "") @@ -261,7 +261,7 @@ func TestGetBridgesByLocation(t *testing.T) { storage.Close() }() - rawString := "{\"healthy\":true,\"host\":\"cod.demo.bitmask.net\",\"ip_addr\":\"37.218.245.94\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" + rawString := "{\"healthy\":true,\"host\":\"cod.demo.example.org\",\"ip_addr\":\"1.2.3.4\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" _ = storage.NewBridge("bridge1", "obfs4", "Paris", rawString) _ = storage.NewBridge("bridge2", "obfs4", "Paris", "bridge2_raw") _ = storage.NewBridge("bridge3", "obfs4", "Prague", "bridge3_raw") @@ -281,7 +281,7 @@ func TestGetBridgesByType(t *testing.T) { storage.Close() }() - rawString := "{\"healthy\":true,\"host\":\"cod.demo.bitmask.net\",\"ip_addr\":\"37.218.245.94\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" + rawString := "{\"healthy\":true,\"host\":\"cod.demo.example.org\",\"ip_addr\":\"1.2.3.4\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" _ = storage.NewBridge("bridge1", "obfs4", "Paris", rawString) _ = storage.NewBridge("bridge2", "obfs4", "Paris", "bridge2_raw") _ = storage.NewBridge("bridge3", "hoppingPt", "Prague", "bridge3_raw") @@ -301,7 +301,7 @@ func TestDeleteBridgeByName(t *testing.T) { storage.Close() }() - rawString := "{\"healthy\":true,\"host\":\"cod.demo.bitmask.net\",\"ip_addr\":\"37.218.245.94\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" + rawString := "{\"healthy\":true,\"host\":\"cod.demo.example.org\",\"ip_addr\":\"1.2.3.4\",\"ip6_addr\":\"\",\"load\":0,\"location\":\"Paris\",\"overloaded\":false,\"port\":443,\"transport\":\"tcp\",\"type\":\"obfs4\",\"options\":{\"cert\":\"XXX\",\"iatMode\":\"0\"},\"bucket\":\"\"}" _ = storage.NewBridge("bridge1", "obfs4", "Paris", rawString) _ = storage.NewBridge("bridge2", "obfs4", "Amsterdam", "bridge2_raw") -- GitLab