Use result and result_code in net_response

This commit is contained in:
Daniel Nelson
2018-05-08 16:04:28 -07:00
parent 54a0532604
commit 078eb47265
3 changed files with 101 additions and 113 deletions

View File

@@ -98,14 +98,14 @@ func TestTCPError(t *testing.T) {
acc.AssertContainsTaggedFields(t,
"net_response",
map[string]interface{}{
"result_code": 1,
"result_code": uint64(2),
"result_type": "connection_failed",
},
map[string]string{
"server": "",
"port": "9999",
"protocol": "tcp",
"result_text": "connection_failed",
"server": "",
"port": "9999",
"protocol": "tcp",
"result": "connection_failed",
},
)
}
@@ -138,16 +138,16 @@ func TestTCPOK1(t *testing.T) {
acc.AssertContainsTaggedFields(t,
"net_response",
map[string]interface{}{
"result_code": 0,
"result_code": uint64(0),
"result_type": "success",
"string_found": true,
"response_time": 1.0,
},
map[string]string{
"result_text": "success",
"server": "127.0.0.1",
"port": "2004",
"protocol": "tcp",
"result": "success",
"server": "127.0.0.1",
"port": "2004",
"protocol": "tcp",
},
)
// Waiting TCPserver
@@ -182,16 +182,16 @@ func TestTCPOK2(t *testing.T) {
acc.AssertContainsTaggedFields(t,
"net_response",
map[string]interface{}{
"result_code": 1,
"result_code": uint64(4),
"result_type": "string_mismatch",
"string_found": false,
"response_time": 1.0,
},
map[string]string{
"result_text": "string_mismatch",
"server": "127.0.0.1",
"port": "2004",
"protocol": "tcp",
"result": "string_mismatch",
"server": "127.0.0.1",
"port": "2004",
"protocol": "tcp",
},
)
// Waiting TCPserver
@@ -218,15 +218,16 @@ func TestUDPError(t *testing.T) {
acc.AssertContainsTaggedFields(t,
"net_response",
map[string]interface{}{
"result_code": 1,
"result_code": uint64(3),
"result_type": "read_failed",
"response_time": 1.0,
"string_found": false,
},
map[string]string{
"result_text": "read_failed",
"server": "",
"port": "9999",
"protocol": "udp",
"result": "read_failed",
"server": "",
"port": "9999",
"protocol": "udp",
},
)
}
@@ -259,16 +260,16 @@ func TestUDPOK1(t *testing.T) {
acc.AssertContainsTaggedFields(t,
"net_response",
map[string]interface{}{
"result_code": 0,
"result_code": uint64(0),
"result_type": "success",
"string_found": true,
"response_time": 1.0,
},
map[string]string{
"result_text": "success",
"server": "127.0.0.1",
"port": "2004",
"protocol": "udp",
"result": "success",
"server": "127.0.0.1",
"port": "2004",
"protocol": "udp",
},
)
// Waiting TCPserver