Browse Source

lwm2m: finish test CID client

pull/14309/head
nickAS21 11 months ago
parent
commit
9e11e21bb8
  1. 9
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/AbstractSecurityLwM2MIntegrationDtlsCidLength16Test.java
  2. 68
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/AbstractSecurityLwM2MIntegrationDtlsCidLengthTest.java
  3. 10
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_0/NoSecLwM2MIntegrationDtlsCidLengthTest.java
  4. 11
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_0/PskLwm2mIntegrationDtlsCidLengthTest.java
  5. 11
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_1/PskLwm2mIntegrationDtlsCidLengthTest.java
  6. 10
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_16/NoSecLwM2MIntegrationDtlsCidLengthTest.java
  7. 11
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_16/PskLwm2mIntegrationDtlsCidLengthTest.java
  8. 2
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_2/PskLwm2mIntegrationDtlsCidLengthTest.java
  9. 11
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_4/PskLwm2mIntegrationDtlsCidLengthTest.java
  10. 2
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_null/NoSecLwM2MIntegrationDtlsCidLengthTest.java
  11. 11
      application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_null/PskLwm2mIntegrationDtlsCidLengthTest.java

9
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/AbstractSecurityLwM2MIntegrationDtlsCidLength16Test.java

@ -30,10 +30,11 @@ public abstract class AbstractSecurityLwM2MIntegrationDtlsCidLength16Test extend
private static final Integer serverDtlsCidLength = 16; private static final Integer serverDtlsCidLength = 16;
protected void testNoSecDtlsCidLength(Integer dtlsCidLength) throws Exception { protected void testNoSecDtlsCidLength(Integer clientDtlsCidLength) throws Exception {
testNoSecDtlsCidLength(dtlsCidLength, serverDtlsCidLength); testNoSecDtlsCidLength(clientDtlsCidLength, serverDtlsCidLength);
} }
protected void testPskDtlsCidLength(Integer dtlsCidLength) throws Exception {
testPskDtlsCidLength(dtlsCidLength, serverDtlsCidLength); protected void testPskDtlsCidLength(Integer clientDtlsCidLength) throws Exception {
testPskDtlsCidLength(clientDtlsCidLength, serverDtlsCidLength);
} }
} }

68
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/AbstractSecurityLwM2MIntegrationDtlsCidLengthTest.java

@ -20,26 +20,20 @@ import org.eclipse.californium.elements.config.Configuration;
import org.eclipse.californium.scandium.DTLSConnector; import org.eclipse.californium.scandium.DTLSConnector;
import org.eclipse.californium.scandium.dtls.Connection; import org.eclipse.californium.scandium.dtls.Connection;
import org.eclipse.californium.scandium.dtls.ConnectionId; import org.eclipse.californium.scandium.dtls.ConnectionId;
import org.eclipse.californium.scandium.dtls.DTLSSession;
import org.eclipse.californium.scandium.dtls.InMemoryReadWriteLockConnectionStore; import org.eclipse.californium.scandium.dtls.InMemoryReadWriteLockConnectionStore;
import org.eclipse.californium.scandium.dtls.ResumptionSupportingConnectionStore; import org.eclipse.californium.scandium.dtls.ResumptionSupportingConnectionStore;
import org.eclipse.leshan.client.californium.endpoint.CaliforniumClientEndpoint; import org.eclipse.leshan.client.californium.endpoint.CaliforniumClientEndpoint;
import org.eclipse.leshan.client.californium.endpoint.CaliforniumClientEndpointsProvider; import org.eclipse.leshan.client.californium.endpoint.CaliforniumClientEndpointsProvider;
import org.eclipse.leshan.client.endpoint.LwM2mClientEndpoint;
import org.eclipse.leshan.client.servers.LwM2mServer; import org.eclipse.leshan.client.servers.LwM2mServer;
import org.eclipse.leshan.core.peer.IpPeer; import org.eclipse.leshan.core.peer.IpPeer;
import org.eclipse.leshan.core.peer.LwM2mPeer;
import org.junit.Assert; import org.junit.Assert;
import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.dao.service.DaoSqlTest;
import org.thingsboard.server.transport.lwm2m.client.Lwm2mServer;
import org.thingsboard.server.transport.lwm2m.security.AbstractSecurityLwM2MIntegrationTest; import org.thingsboard.server.transport.lwm2m.security.AbstractSecurityLwM2MIntegrationTest;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static org.awaitility.Awaitility.await; import static org.awaitility.Awaitility.await;
@ -54,13 +48,13 @@ public abstract class AbstractSecurityLwM2MIntegrationDtlsCidLengthTest extends
protected String awaitAlias; protected String awaitAlias;
protected void testNoSecDtlsCidLength(Integer dtlsCidLength, Integer serverDtlsCidLength) throws Exception { protected void testNoSecDtlsCidLength(Integer clientDtlsCidLength, Integer serverDtlsCidLength) throws Exception {
initDeviceCredentialsNoSek(); initDeviceCredentialsNoSek();
basicTestConnectionDtlsCidLength(dtlsCidLength, serverDtlsCidLength); basicTestConnectionDtlsCidLength(clientDtlsCidLength, serverDtlsCidLength);
} }
protected void testPskDtlsCidLength(Integer dtlsCidLength, Integer serverDtlsCidLength) throws Exception { protected void testPskDtlsCidLength(Integer clientDtlsCidLength, Integer serverDtlsCidLength) throws Exception {
initDeviceCredentialsPsk(); initDeviceCredentialsPsk();
basicTestConnectionDtlsCidLength(dtlsCidLength, serverDtlsCidLength); basicTestConnectionDtlsCidLength(clientDtlsCidLength, serverDtlsCidLength);
} }
protected void basicTestConnectionDtlsCidLength(Integer clientDtlsCidLength, protected void basicTestConnectionDtlsCidLength(Integer clientDtlsCidLength,
@ -84,31 +78,38 @@ public abstract class AbstractSecurityLwM2MIntegrationDtlsCidLengthTest extends
Assert.assertTrue(lwM2MTestClient.getClientDtlsCid().isEmpty()); Assert.assertTrue(lwM2MTestClient.getClientDtlsCid().isEmpty());
} else { } else {
Assert.assertEquals(2L, lwM2MTestClient.getClientDtlsCid().size()); Assert.assertEquals(2L, lwM2MTestClient.getClientDtlsCid().size());
Assert.assertTrue(lwM2MTestClient.getClientDtlsCid().keySet().contains(ON_READ_CONNECTION_ID)); Assert.assertTrue(lwM2MTestClient.getClientDtlsCid().containsKey(ON_READ_CONNECTION_ID));
if (serverDtlsCidLength == null) { Assert.assertTrue(lwM2MTestClient.getClientDtlsCid().containsKey(ON_WRITE_CONNECTION_ID));
LwM2mServer lwM2mServer = lwM2MTestClient.getLeshanClient().getRegisteredServers().entrySet().stream().findFirst().get().getValue();
CaliforniumClientEndpoint lwM2mClientEndpoint = (CaliforniumClientEndpoint) lwM2MTestClient.getLeshanClient().getEndpoint(lwM2mServer);
Connection connection = getConnection(lwM2mClientEndpoint, lwM2mServer);
ConnectionId clientCid = connection.getConnectionId();
ConnectionId readCid = connection.getEstablishedDtlsContext().getReadConnectionId();
ConnectionId serverCid = connection.getEstablishedDtlsContext().getWriteConnectionId();
if (serverDtlsCidLength == null || clientDtlsCidLength == null) {
// cid is not used
Assert.assertNull(lwM2MTestClient.getClientDtlsCid().get(ON_WRITE_CONNECTION_ID)); Assert.assertNull(lwM2MTestClient.getClientDtlsCid().get(ON_WRITE_CONNECTION_ID));
Assert.assertNull(lwM2MTestClient.getClientDtlsCid().get(ON_READ_CONNECTION_ID)); Assert.assertNull(lwM2MTestClient.getClientDtlsCid().get(ON_READ_CONNECTION_ID));
Assert.assertNull(readCid);
Assert.assertNull(serverCid);
} else { } else {
Assert.assertEquals(serverDtlsCidLength, lwM2MTestClient.getClientDtlsCid().get(ON_WRITE_CONNECTION_ID));
Assert.assertEquals(clientDtlsCidLength, lwM2MTestClient.getClientDtlsCid().get(ON_READ_CONNECTION_ID)); Assert.assertEquals(clientDtlsCidLength, lwM2MTestClient.getClientDtlsCid().get(ON_READ_CONNECTION_ID));
if (clientDtlsCidLength == null) { // cid used
Assert.assertNull(lwM2MTestClient.getClientDtlsCid().get(ON_READ_CONNECTION_ID)); Assert.assertNotNull(clientCid);
} else { Assert.assertNotNull(readCid);
Integer expectedWrite = Math.max(clientDtlsCidLength, serverDtlsCidLength); if (clientDtlsCidLength > 0) {
// Assert.assertEquals(expectedWrite, lwM2MTestClient.getClientDtlsCid().get(ON_WRITE_CONNECTION_ID)); Assert.assertEquals(clientCid, readCid);
Assert.assertEquals(serverDtlsCidLength, lwM2MTestClient.getClientDtlsCid().get(ON_WRITE_CONNECTION_ID));
} }
Assert.assertNotNull(serverCid);
int actualServerCidLength = serverCid.getBytes().length;
int expectedServerCidLength = serverDtlsCidLength;
Assert.assertEquals(expectedServerCidLength, actualServerCidLength);
} }
LwM2mServer lwM2mServer = lwM2MTestClient.getLeshanClient().getRegisteredServers().entrySet().stream().findFirst().get().getValue();
CaliforniumClientEndpoint lwM2mClientEndpoint = (CaliforniumClientEndpoint) lwM2MTestClient.getLeshanClient().getEndpoint(lwM2mServer); if (clientCid != null) {
DTLSConnector connector = (DTLSConnector) lwM2mClientEndpoint.getCoapEndpoint().getConnector(); int actualClientCidLength = clientCid.getBytes().length;
Field field = DTLSConnector.class.getDeclaredField("connectionStore");
field.setAccessible(true);
ResumptionSupportingConnectionStore connectionStore = (InMemoryReadWriteLockConnectionStore) field.get(connector);
InetSocketAddress serverAddr = ((IpPeer) lwM2mServer.getTransportData()).getSocketAddress();
Connection connection = connectionStore.get(serverAddr);
ConnectionId cid = connection.getConnectionId();
if (cid != null) {
int actualClientCidLength = cid.getBytes().length;
int expectedClientCidLength; int expectedClientCidLength;
if (clientDtlsCidLength == null || clientDtlsCidLength == 0) { if (clientDtlsCidLength == null || clientDtlsCidLength == 0) {
expectedClientCidLength = 3; expectedClientCidLength = 3;
@ -119,4 +120,13 @@ public abstract class AbstractSecurityLwM2MIntegrationDtlsCidLengthTest extends
} }
} }
} }
private static Connection getConnection(CaliforniumClientEndpoint lwM2mClientEndpoint, LwM2mServer lwM2mServer) throws NoSuchFieldException, IllegalAccessException {
DTLSConnector connector = (DTLSConnector) lwM2mClientEndpoint.getCoapEndpoint().getConnector();
Field field = DTLSConnector.class.getDeclaredField("connectionStore");
field.setAccessible(true);
ResumptionSupportingConnectionStore connectionStore = (InMemoryReadWriteLockConnectionStore) field.get(connector);
InetSocketAddress serverAddr = ((IpPeer) lwM2mServer.getTransportData()).getSocketAddress();
return connectionStore.get(serverAddr);
}
} }

10
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_0/NoSecLwM2MIntegrationDtlsCidLengthTest.java

@ -27,7 +27,7 @@ public class NoSecLwM2MIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2
@Before @Before
public void setUpNoSecDtlsCidLength() { public void setUpNoSecDtlsCidLength() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(NO_SEC, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(NO_SEC, NONE));
awaitAlias = "await on client state (NoSec_Lwm2m) DtlsCidLength = 0"; awaitAlias = "await on client state (NoSec_Lwm2m) serverDtlsCidLength = 0";
} }
@Test @Test
@ -46,13 +46,13 @@ public class NoSecLwM2MIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2
} }
@Test @Test
public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testNoSecDtlsCidLength(4); testNoSecDtlsCidLength(1);
} }
@Test @Test
public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testNoSecDtlsCidLength(8); testNoSecDtlsCidLength(4);
} }
@Test @Test

11
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_0/PskLwm2mIntegrationDtlsCidLengthTest.java

@ -27,7 +27,7 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
@Before @Before
public void createProfileRpc() { public void createProfileRpc() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE));
awaitAlias = "await on client state (Psk_Lwm2m) DtlsCidLength = 0"; awaitAlias = "await on client state (Psk_Lwm2m) serverDtlsCidLength = 0";
} }
@Test @Test
@ -45,14 +45,15 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testPskDtlsCidLength(4); testPskDtlsCidLength(2);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testPskDtlsCidLength(8); testPskDtlsCidLength(4);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception {
testPskDtlsCidLength(16); testPskDtlsCidLength(16);

11
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_1/PskLwm2mIntegrationDtlsCidLengthTest.java

@ -28,7 +28,7 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
@Before @Before
public void createProfileRpc() { public void createProfileRpc() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE));
awaitAlias = "await on client state (Psk_Lwm2m) DtlsCidLength = 1"; awaitAlias = "await on client state (Psk_Lwm2m) serverDtlsCidLength = 1";
} }
@Test @Test
@ -47,14 +47,15 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testPskDtlsCidLength(4); testPskDtlsCidLength(2);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testPskDtlsCidLength(8); testPskDtlsCidLength(4);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception {
testPskDtlsCidLength(16); testPskDtlsCidLength(16);

10
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_16/NoSecLwM2MIntegrationDtlsCidLengthTest.java

@ -28,7 +28,7 @@ public class NoSecLwM2MIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2
@Before @Before
public void setUpNoSecDtlsCidLength() { public void setUpNoSecDtlsCidLength() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(NO_SEC, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(NO_SEC, NONE));
awaitAlias = "await on client state (NoSec_Lwm2m) DtlsCidLength = 16"; awaitAlias = "await on client state (NoSec_Lwm2m) serverDtlsCidLength = 16";
} }
@Test @Test
@ -47,13 +47,13 @@ public class NoSecLwM2MIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2
} }
@Test @Test
public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testNoSecDtlsCidLength(4); testNoSecDtlsCidLength(2);
} }
@Test @Test
public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithNoSecConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testNoSecDtlsCidLength(8); testNoSecDtlsCidLength(4);
} }
@Test @Test

11
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_16/PskLwm2mIntegrationDtlsCidLengthTest.java

@ -28,7 +28,7 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
@Before @Before
public void createProfileRpc() { public void createProfileRpc() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE));
awaitAlias = "await on client state (Psk_Lwm2m) DtlsCidLength = 16"; awaitAlias = "await on client state (Psk_Lwm2m) serverDtlsCidLength = 16";
} }
@Test @Test
@ -47,14 +47,15 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testPskDtlsCidLength(4); testPskDtlsCidLength(2);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testPskDtlsCidLength(8); testPskDtlsCidLength(4);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception {
testPskDtlsCidLength(16); testPskDtlsCidLength(16);

2
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_2/PskLwm2mIntegrationDtlsCidLengthTest.java

@ -27,7 +27,7 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
@Before @Before
public void createProfileRpc() { public void createProfileRpc() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE));
awaitAlias = "await on client state (Psk_Lwm2m) DtlsCidLength = 2"; awaitAlias = "await on client state (Psk_Lwm2m) serverDtlsCidLength = 2";
} }
@Test @Test

11
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_4/PskLwm2mIntegrationDtlsCidLengthTest.java

@ -27,7 +27,7 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
@Before @Before
public void createProfileRpc() { public void createProfileRpc() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE));
awaitAlias = "await on client state (Psk_Lwm2m) DtlsCidLength = 4"; awaitAlias = "await on client state (Psk_Lwm2m) serverDtlsCidLength = 4";
} }
@Test @Test
@ -46,14 +46,15 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testPskDtlsCidLength(4); testPskDtlsCidLength(2);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testPskDtlsCidLength(8); testPskDtlsCidLength(4);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception {
testPskDtlsCidLength(16); testPskDtlsCidLength(16);

2
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_null/NoSecLwM2MIntegrationDtlsCidLengthTest.java

@ -27,7 +27,7 @@ public class NoSecLwM2MIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2
@Before @Before
public void setUpNoSecDtlsCidLength() { public void setUpNoSecDtlsCidLength() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(NO_SEC, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(NO_SEC, NONE));
awaitAlias = "await on client state (NoSec_Lwm2m) DtlsCidLength = Null"; awaitAlias = "await on client state (NoSec_Lwm2m) serverDtlsCidLength = Null";
} }
@Test @Test

11
application/src/test/java/org/thingsboard/server/transport/lwm2m/security/cid/serverDtlsCidLength_null/PskLwm2mIntegrationDtlsCidLengthTest.java

@ -27,7 +27,7 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
@Before @Before
public void createProfileRpc() { public void createProfileRpc() {
transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE)); transportConfiguration = getTransportConfiguration(OBSERVE_ATTRIBUTES_WITHOUT_PARAMS, getBootstrapServerCredentialsSecure(PSK, NONE));
awaitAlias = "await on client state (Psk_Lwm2m) DtlsCidLength = Null"; awaitAlias = "await on client state (Psk_Lwm2m) serverDtlsCidLength = Null";
} }
@Test @Test
@ -46,14 +46,15 @@ public class PskLwm2mIntegrationDtlsCidLengthTest extends AbstractSecurityLwM2MI
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_2() throws Exception {
testPskDtlsCidLength(4); testPskDtlsCidLength(2);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_8() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_4() throws Exception {
testPskDtlsCidLength(8); testPskDtlsCidLength(4);
} }
@Test @Test
public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception { public void testWithPskConnectLwm2mSuccessClientDtlsCidLength_16() throws Exception {
testPskDtlsCidLength(16); testPskDtlsCidLength(16);

Loading…
Cancel
Save