-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental support for requesting messages on behalf of auxiliary addresses only (not mycall). Ref la5nta/pat#428
- Loading branch information
1 parent
f11f6c0
commit 793eeec
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
"bufio" | ||
"fmt" | ||
"net" | ||
"os" | ||
"strings" | ||
"testing" | ||
) | ||
|
@@ -46,6 +47,42 @@ func TestSessionP2P(t *testing.T) { | |
} | ||
} | ||
|
||
func TestFWAuxOnlyExperiment(t *testing.T) { | ||
os.Setenv("FW_AUX_ONLY_EXPERIMENT", "1") | ||
defer os.Setenv("FW_AUX_ONLY_EXPERIMENT", "0") | ||
|
||
client, master := net.Pipe() | ||
|
||
clientErr := make(chan error) | ||
go func() { | ||
s := NewSession("LA5NTA", "N0CALL", "JO39EQ", nil) | ||
s.AddAuxiliaryAddress(AddressFromString("[email protected]")) | ||
_, err := s.Exchange(client) | ||
clientErr <- err | ||
}() | ||
|
||
masterErr := make(chan error) | ||
go func() { | ||
s := NewSession("N0CALL", "LA5NTA", "JO39EQ", nil) | ||
s.IsMaster(true) | ||
_, err := s.Exchange(master) | ||
switch fw := s.RemoteForwarders(); { | ||
case len(fw) != 1: | ||
t.Errorf("unexpected FW count: %d", len(fw)) | ||
case fw[0].String() != "EMCOMM-1": | ||
t.Errorf("unexpected FW address: %q", fw[0]) | ||
} | ||
masterErr <- err | ||
}() | ||
|
||
if err := <-masterErr; err != nil { | ||
t.Errorf("Master returned with error: %s", err) | ||
} | ||
if err := <-clientErr; err != nil { | ||
t.Errorf("Client returned with error: %s", err) | ||
} | ||
} | ||
|
||
func TestSessionCMS(t *testing.T) { | ||
client, srv := net.Pipe() | ||
|
||
|