|
@@ -438,3 +438,69 @@ SCENARIO("Integration test of Transport layer - reset transport layer", "[integr
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+SCENARIO("Integration test of Transport layer - addressing", "[integration, transport]")
|
|
|
|
+{
|
|
|
|
+ GIVEN("Shellmatta up and running with one command - transport layer with UUID")
|
|
|
|
+ {
|
|
|
|
+ shellmatta_instance_t inst;
|
|
|
|
+ shellmatta_handle_t handle;
|
|
|
|
+ shellmatta_retCode_t ret;
|
|
|
|
+ char buffer[1024];
|
|
|
|
+ char historyBuffer[1024];
|
|
|
|
+
|
|
|
|
+ shellmatta_doInit( &inst,
|
|
|
|
+ &handle,
|
|
|
|
+ buffer,
|
|
|
|
+ sizeof(buffer),
|
|
|
|
+ historyBuffer,
|
|
|
|
+ sizeof(historyBuffer),
|
|
|
|
+ "shellmatta->",
|
|
|
|
+ NULL,
|
|
|
|
+ writeFct);
|
|
|
|
+ shellmatta_addCmd(handle, &doSomethingCmd);
|
|
|
|
+
|
|
|
|
+ ret = shellmatta_transport_configure(handle, true, false, (uint8_t *)"123456789012345", NULL);
|
|
|
|
+ CHECK(ret == SHELLMATTA_OK);
|
|
|
|
+
|
|
|
|
+ write_callCnt = 0u;
|
|
|
|
+ memset(write_data, 0, sizeof(write_data));
|
|
|
|
+ write_length = 0u;
|
|
|
|
+
|
|
|
|
+ WHEN("The shellmatta is searched using an invalid range") {
|
|
|
|
+ ret = shellmatta_transport_configure(handle, true, false, NULL, NULL);
|
|
|
|
+
|
|
|
|
+ /* check with valid payload - disable echo to reduce cluttering */
|
|
|
|
+ shellmatta_configure(handle, SHELLMATTA_MODE_INSERT, false, '\r');
|
|
|
|
+ shellmatta_processData(handle, (char*)"\x01\x01\x03\x20\x00\x00\x00\x00"
|
|
|
|
+ "234567890123456\0"
|
|
|
|
+ "345678901234567\0"
|
|
|
|
+ "\x93\x0c\xc3\x04", 44u);
|
|
|
|
+
|
|
|
|
+ THEN("The shellmatta does not respond")
|
|
|
|
+ {
|
|
|
|
+ CHECK(write_length == 0);
|
|
|
|
+ CHECK(inst.transportLayer.sequenceH2S == 1);
|
|
|
|
+ REQUIRE(inst.transportLayer.state == SHELLMATTA_TRANSPORT_STATE_WAIT);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ WHEN("The shellmatta is searched using a valid range") {
|
|
|
|
+ ret = shellmatta_transport_configure(handle, true, false, NULL, NULL);
|
|
|
|
+
|
|
|
|
+ /* check with valid payload - disable echo to reduce cluttering */
|
|
|
|
+ shellmatta_configure(handle, SHELLMATTA_MODE_INSERT, false, '\r');
|
|
|
|
+ shellmatta_processData(handle, (char*)"\x01\x01\x03\x20\x00\x00\x00\x00"
|
|
|
|
+ "123456789012344\0"
|
|
|
|
+ "345678901234567\0"
|
|
|
|
+ "\x9b\x69\x59\x5f", 44u);
|
|
|
|
+
|
|
|
|
+ THEN("The shellmatta does not respond")
|
|
|
|
+ {
|
|
|
|
+ CHECK(write_length == 28);
|
|
|
|
+ CHECK(inst.transportLayer.sequenceH2S == 1);
|
|
|
|
+ REQUIRE(inst.transportLayer.state == SHELLMATTA_TRANSPORT_STATE_WAIT);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|