@@ -96,7 +96,7 @@ func TestServerAndClientE2E(t *testing.T) {
9696 name : "Localhost-v4" ,
9797 ips : []string {"127.0.0.1" },
9898 want : map [string ]* annotator.ClientAnnotations {
99- "127.0.0.1" : & annotator. ClientAnnotations {
99+ "127.0.0.1" : {
100100 Network : & annotator.Network {
101101 Missing : true ,
102102 },
@@ -110,7 +110,7 @@ func TestServerAndClientE2E(t *testing.T) {
110110 name : "Localhost-v6" ,
111111 ips : []string {"::1" },
112112 want : map [string ]* annotator.ClientAnnotations {
113- "::1" : & annotator. ClientAnnotations {
113+ "::1" : {
114114 Network : & annotator.Network {
115115 Missing : true ,
116116 },
@@ -124,7 +124,7 @@ func TestServerAndClientE2E(t *testing.T) {
124124 name : "IP that has everything" ,
125125 ips : []string {"2.125.160.216" },
126126 want : map [string ]* annotator.ClientAnnotations {
127- "2.125.160.216" : & annotator. ClientAnnotations {
127+ "2.125.160.216" : {
128128 Network : & annotator.Network {
129129 CIDR : "2.120.0.0/13" ,
130130 ASNumber : 5607 ,
@@ -154,7 +154,7 @@ func TestServerAndClientE2E(t *testing.T) {
154154 name : "Multiple IPs" ,
155155 ips : []string {"2.125.160.216" , "127.0.0.1" },
156156 want : map [string ]* annotator.ClientAnnotations {
157- "2.125.160.216" : & annotator. ClientAnnotations {
157+ "2.125.160.216" : {
158158 Network : & annotator.Network {
159159 CIDR : "2.120.0.0/13" ,
160160 ASNumber : 5607 ,
@@ -178,7 +178,7 @@ func TestServerAndClientE2E(t *testing.T) {
178178 AccuracyRadiusKm : 100 ,
179179 },
180180 },
181- "127.0.0.1" : & annotator. ClientAnnotations {
181+ "127.0.0.1" : {
182182 Network : & annotator.Network {
183183 Missing : true ,
184184 },
@@ -211,17 +211,15 @@ func TestServerAndClientE2E(t *testing.T) {
211211 wg .Wait ()
212212}
213213
214- func TestNewServerError (t * testing.T ) {
215- // Server creation fails when the socket file already exists. So make a file
216- // and use its name to generate an error.
214+ func TestNewServerWithExistingFile (t * testing.T ) {
215+ // Server creation should succeed even when the socket file already exists.
216+ // So make a file and use its name to start the server, hopefully without error.
217217 f , err := ioutil .TempFile ("" , "TextNewServerError" )
218218 rtx .Must (err , "Could not create tempfile" )
219219 defer os .Remove (f .Name ())
220220
221221 _ , err = NewServer (f .Name (), asn , geo )
222- if err == nil {
223- t .Error ("We should have had an error, but did not" )
224- }
222+ rtx .Must (err , "Should not have had an error when starting NewServer wth an existing file" )
225223}
226224
227225func TestNewClient (t * testing.T ) {
0 commit comments