summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_relaymsg_test.go
diff options
context:
space:
mode:
authorSean Karlage <skarlage@fb.com>2018-08-11 14:30:48 -0700
committerSean Karlage <skarlage@fb.com>2018-08-11 14:32:26 -0700
commit8ea2525c898436a2a935580de67727bbe7035c85 (patch)
tree69d35d17c238feabb07ef07a907aae5520104911 /dhcpv6/option_relaymsg_test.go
parent2b05c7d03724d31529886d98f738499ac06ead7e (diff)
parenta6212f1f72e94821a29894fb66656a981bd035d0 (diff)
Merge branch 'master' into dhcpv4-moar-tests
Diffstat (limited to 'dhcpv6/option_relaymsg_test.go')
-rw-r--r--dhcpv6/option_relaymsg_test.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/dhcpv6/option_relaymsg_test.go b/dhcpv6/option_relaymsg_test.go
index 6d9d6a6..df2442c 100644
--- a/dhcpv6/option_relaymsg_test.go
+++ b/dhcpv6/option_relaymsg_test.go
@@ -7,7 +7,7 @@ import (
func TestRelayMsgParseOptRelayMsg(t *testing.T) {
opt, err := ParseOptRelayMsg([]byte{
- 1, // SOLICIT
+ 1, // MessageTypeSolicit
0xaa, 0xbb, 0xcc, // transaction ID
0, 8, // option: elapsed time
0, 2, // option length
@@ -16,9 +16,9 @@ func TestRelayMsgParseOptRelayMsg(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if code := opt.Code(); code != OPTION_RELAY_MSG {
- t.Fatalf("Invalid option code. Expected OPTION_RELAY_MSG (%v), got %v",
- OPTION_RELAY_MSG, code,
+ if code := opt.Code(); code != OptionRelayMsg {
+ t.Fatalf("Invalid option code. Expected OptionRelayMsg (%v), got %v",
+ OptionRelayMsg, code,
)
}
}
@@ -27,7 +27,7 @@ func TestRelayMsgOptionsFromBytes(t *testing.T) {
opts, err := OptionsFromBytes([]byte{
0, 9, // option: relay message
0, 10, // relayed message length
- 1, // SOLICIT
+ 1, // MessageTypeSolicit
0xaa, 0xbb, 0xcc, // transaction ID
0, 8, // option: elapsed time
0, 2, // option length
@@ -40,9 +40,9 @@ func TestRelayMsgOptionsFromBytes(t *testing.T) {
t.Fatalf("Invalid number of options. Expected 1, got %v", len(opts))
}
opt := opts[0]
- if code := opt.Code(); code != OPTION_RELAY_MSG {
- t.Fatalf("Invalid option code. Expected OPTION_RELAY_MSG (%v), got %v",
- OPTION_RELAY_MSG, code,
+ if code := opt.Code(); code != OptionRelayMsg {
+ t.Fatalf("Invalid option code. Expected OptionRelayMsg (%v), got %v",
+ OptionRelayMsg, code,
)
}
}
@@ -55,7 +55,7 @@ func TestRelayMsgParseOptRelayMsgSingleEncapsulation(t *testing.T) {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, // peerAddr
0, 9, // option: relay message
0, 10, // relayed message length
- 1, // SOLICIT
+ 1, // MessageTypeSolicit
0xaa, 0xbb, 0xcc, // transaction ID
0, 8, // option: elapsed time
0, 2, // option length
@@ -70,15 +70,15 @@ func TestRelayMsgParseOptRelayMsgSingleEncapsulation(t *testing.T) {
reflect.TypeOf(d),
)
}
- if mType := r.Type(); mType != RELAY_FORW {
- t.Fatalf("Invalid messge type for relay. Expected %v, got %v", RELAY_FORW, mType)
+ if mType := r.Type(); mType != MessageTypeRelayForward {
+ t.Fatalf("Invalid messge type for relay. Expected %v, got %v", MessageTypeRelayForward, mType)
}
if len(r.options) != 1 {
t.Fatalf("Invalid number of options. Expected 1, got %v", len(r.options))
}
- if code := r.options[0].Code(); code != OPTION_RELAY_MSG {
- t.Fatalf("Invalid option code. Expected OPTION_RELAY_MSG (%v), got %v",
- OPTION_RELAY_MSG, code,
+ if code := r.options[0].Code(); code != OptionRelayMsg {
+ t.Fatalf("Invalid option code. Expected OptionRelayMsg (%v), got %v",
+ OptionRelayMsg, code,
)
}
opt := r.options[0]
@@ -94,9 +94,9 @@ func TestRelayMsgParseOptRelayMsgSingleEncapsulation(t *testing.T) {
reflect.TypeOf(innerDHCP),
)
}
- if dType := innerDHCP.Type(); dType != SOLICIT {
- t.Fatalf("Invalid inner DHCP type. Expected SOLICIT (%v), got %v",
- SOLICIT, dType,
+ if dType := innerDHCP.Type(); dType != MessageTypeSolicit {
+ t.Fatalf("Invalid inner DHCP type. Expected MessageTypeSolicit (%v), got %v",
+ MessageTypeSolicit, dType,
)
}
if tID := innerDHCP.TransactionID(); tID != 0xaabbcc {