From 5d4eb03320b4a949486f332530332c8635a86c30 Mon Sep 17 00:00:00 2001 From: Vitaly Khalmansky Date: Thu, 24 Aug 2023 23:30:10 +0200 Subject: [PATCH 1/2] fix(uat): use CURRENT for classpath component in second deployments --- .../greengrass/features/ggmq-1.feature | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature b/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature index f5f10cc3f..fc050a1ab 100644 --- a/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature +++ b/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature @@ -11,10 +11,10 @@ Feature: GGMQ-1 @GGMQ-1-T1 Scenario Outline: GGMQ-1-T1--: As a customer, I can connect, subscribe/publish at QoS 0 and 1 and receive using client application to MQTT topic When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "clientDeviceTest" When I associate "clientDeviceTest" with ggc And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: @@ -189,10 +189,10 @@ Feature: GGMQ-1 And I disconnect device "clientDeviceTest" with reason code 0 When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | LATEST | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | CURRENT | And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: """ { @@ -223,7 +223,7 @@ Feature: GGMQ-1 } """ And I deploy the Greengrass deployment configuration - Then the Greengrass deployment is COMPLETED on the device after 2 minutes + Then the Greengrass deployment is COMPLETED on the device after 299 seconds And the aws.greengrass.clientdevices.mqtt.EMQX log on the device contains the line "is running now!." within 1 minutes And I discover core device broker as "default_broker" from "clientDeviceTest" in OTF @@ -577,10 +577,10 @@ Feature: GGMQ-1 @GGMQ-1-T13 Scenario Outline: GGMQ-1-T13--: As a customer, I can connect two GGADs and send message from one GGAD to the other based on CDA configuration When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "publisher" And I create client device "subscriber" @@ -656,10 +656,10 @@ Feature: GGMQ-1 And I disconnect device "publisher" with reason code 0 When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | LATEST | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | CURRENT | And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: """ @@ -1316,11 +1316,11 @@ Feature: GGMQ-1 @GGMQ-1-T20 Scenario Outline: GGMQ-1-T20--: As a customer, I can associate and connect GGADs with GGC over custom port When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | aws.greengrass.Cli | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | aws.greengrass.Cli | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "basic_connect" And I create client device "basic_connect_2" When I associate "basic_connect" with ggc @@ -1478,10 +1478,10 @@ Feature: GGMQ-1 @GGMQ-1-T21 Scenario Outline: GGMQ-1-T21--: As a customer, I change the connectivity ip address and GGADs are able to connect via IPD When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "basic_connect" When I associate "basic_connect" with ggc And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: @@ -1673,11 +1673,11 @@ Feature: GGMQ-1 @GGMQ-1-T24 Scenario Outline: GGMQ-1-T24--: As a customer, I can reset CDA config and update it and CDA will use the new config When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | aws.greengrass.Cli | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | aws.greengrass.Cli | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "publisher" And I create client device "subscriber" @@ -1828,10 +1828,10 @@ Feature: GGMQ-1 @GGMQ-1-T25 Scenario Outline: GGMQ-1-T25--: As a customer, I connect with same client id twice (not reconnect) and be able to publish and subscribe to messages. When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "publisher" And I create client device "subscriber" When I associate "publisher" with ggc @@ -1940,10 +1940,10 @@ Feature: GGMQ-1 @GGMQ-1-T26 Scenario Outline: GGMQ-1-T26--: As a customer, my GGAD stays connected when CDA rotates cert for EMQX broker When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "clientDeviceTest" When I associate "clientDeviceTest" with ggc And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: @@ -2055,10 +2055,10 @@ Feature: GGMQ-1 @GGMQ-1-T27 @OffTheNetwork Scenario Outline: GGMQ-1-T27--: As a customer, my Greengrass-issued certificate does not rotate when mqtt reconnects When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "clientDeviceTest" When I associate "clientDeviceTest" with ggc And I update my Greengrass deployment configuration, setting the component aws.greengrass.Nucleus configuration to: @@ -2764,10 +2764,10 @@ Feature: GGMQ-1 @GGMQ-1-T103 Scenario Outline: GGMQ-1-T103--: As a customer, I can discover Core device broker in AWS IoT device SDK-based client When I create a Greengrass deployment with components - | aws.greengrass.clientdevices.Auth | LATEST | - | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | - | aws.greengrass.clientdevices.IPDetector | LATEST | - | | classpath:/local-store/recipes/ | + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | | classpath:/local-store/recipes/ | And I create client device "clientDeviceTest" When I associate "clientDeviceTest" with ggc And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: From da7dabf56eca8a94b796b5521d9f902ef8b9187a Mon Sep 17 00:00:00 2001 From: Vitaly Khalmansky Date: Fri, 25 Aug 2023 15:33:33 +0200 Subject: [PATCH 2/2] docs(uat): resolve issues related to javadoc generation --- .../mqtt/client/control/api/AgentControl.java | 4 ++-- .../mqtt/client/control/api/ConnectionControl.java | 14 +++++++------- .../control/implementation/AgentControlImpl.java | 8 ++++---- .../com/aws/greengrass/steps/MqttControlSteps.java | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/AgentControl.java b/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/AgentControl.java index e2e24379f..acb4c8953 100644 --- a/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/AgentControl.java +++ b/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/AgentControl.java @@ -93,7 +93,7 @@ ConnectionControl createMqttConnection(@NonNull MqttConnectRequest connectReques * Shutdown whole agent. * * @param reason shutdown reason - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ void shutdownAgent(String reason); @@ -103,7 +103,7 @@ ConnectionControl createMqttConnection(@NonNull MqttConnectRequest connectReques * * @param discoveryRequest the request with clients name and credentials * @return the reply with connectivity information of IoT Core device broker - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ CoreDeviceDiscoveryReply discoveryCoreDevice(@NonNull CoreDeviceDiscoveryRequest discoveryRequest); } diff --git a/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/ConnectionControl.java b/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/ConnectionControl.java index 097b423a4..b51e3fa7e 100644 --- a/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/ConnectionControl.java +++ b/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/api/ConnectionControl.java @@ -74,7 +74,7 @@ public interface ConnectionControl { * @param subscriptionId optional subscription id * @param subscriptions MQTT subscriptions * @return reply to subscribe - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ default MqttSubscribeReply subscribeMqtt(Integer subscriptionId, @NonNull Mqtt5Subscription... subscriptions) { final List userProperties = null; @@ -88,7 +88,7 @@ default MqttSubscribeReply subscribeMqtt(Integer subscriptionId, @NonNull Mqtt5S * @param userProperties optional MQTT v5.0 user properties * @param subscriptions MQTT subscriptions * @return reply to subscribe - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ MqttSubscribeReply subscribeMqtt(Integer subscriptionId, List userProperties, @NonNull Mqtt5Subscription... subscriptions); @@ -98,7 +98,7 @@ MqttSubscribeReply subscribeMqtt(Integer subscriptionId, List u * * @param message message to publish * @return publish's response - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ MqttPublishReply publishMqtt(@NonNull Mqtt5Message message); @@ -108,7 +108,7 @@ MqttSubscribeReply subscribeMqtt(Integer subscriptionId, List u * * @param filters topic filters to unsubscribe * @return reply to unsubscribe - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ default MqttSubscribeReply unsubscribeMqtt(@NonNull String... filters) { final List userProperties = null; @@ -121,7 +121,7 @@ default MqttSubscribeReply unsubscribeMqtt(@NonNull String... filters) { * @param userProperties optional MQTT v5.0 user properties * @param filters topic filters to unsubscribe * @return reply to unsubscribe - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ MqttSubscribeReply unsubscribeMqtt(List userProperties, @NonNull String... filters); @@ -129,7 +129,7 @@ default MqttSubscribeReply unsubscribeMqtt(@NonNull String... filters) { * Close MQTT connection to the broker. * * @param reason reason code of disconnection as specified by MQTT v5.0 in DISCONNECT packet - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ default void closeMqttConnection(int reason) { closeMqttConnection(reason, null); @@ -140,7 +140,7 @@ default void closeMqttConnection(int reason) { * * @param reason reason code of disconnection as specified by MQTT v5.0 in DISCONNECT packet * @param userProperties optional MQTT v5.0 user properties - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ void closeMqttConnection(int reason, List userProperties); } diff --git a/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/implementation/AgentControlImpl.java b/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/implementation/AgentControlImpl.java index 570731c25..7c6df697c 100644 --- a/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/implementation/AgentControlImpl.java +++ b/uat/mqtt-client-control/src/main/java/com/aws/greengrass/testing/mqtt/client/control/implementation/AgentControlImpl.java @@ -225,7 +225,7 @@ boolean isOnThatAddress(@NonNull String address, int port) { * * @param subscribeRequest subscribe request * @return reply to subscribe - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ MqttSubscribeReply subscribeMqtt(@NonNull MqttSubscribeRequest subscribeRequest) { int connectionId = subscribeRequest.getConnectionId().getConnectionId(); @@ -238,7 +238,7 @@ MqttSubscribeReply subscribeMqtt(@NonNull MqttSubscribeRequest subscribeRequest) * * @param unsubscribeRequest unsubscribe request * @return reply to unsubscribe - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ MqttSubscribeReply unsubscribeMqtt(@NonNull MqttUnsubscribeRequest unsubscribeRequest) { int connectionId = unsubscribeRequest.getConnectionId().getConnectionId(); @@ -251,7 +251,7 @@ MqttSubscribeReply unsubscribeMqtt(@NonNull MqttUnsubscribeRequest unsubscribeRe * * @param publishRequest publish request * @return reply to publish - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ MqttPublishReply publishMqtt(@NonNull MqttPublishRequest publishRequest) { int connectionId = publishRequest.getConnectionId().getConnectionId(); @@ -264,7 +264,7 @@ MqttPublishReply publishMqtt(@NonNull MqttPublishRequest publishRequest) { * Close MQTT connection to the broker. * * @param closeRequest parameters of MQTT disconnect - * @throws StatusRuntimeException on errors + * @throws io.grpc.StatusRuntimeException on errors */ void closeMqttConnection(@NonNull MqttCloseRequest closeRequest) { blockingStub.closeMqttConnection(closeRequest); diff --git a/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java b/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java index af7c38144..485327776 100644 --- a/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java +++ b/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java @@ -304,6 +304,7 @@ public MqttControlSteps( * Convert boolean string to value. * * @param value the string value of boolean + * @return boolean object of value */ @SuppressWarnings("PMD.UnnecessaryAnnotationValueElement") @ParameterType(value = "true|True|TRUE|false|False|FALSE") @@ -315,6 +316,7 @@ public Boolean booleanValue(String value) { * Convert boolean or null string to nullable value. * * @param value the string value of boolean or null + * @return boolean object of value or null */ @SuppressWarnings("PMD.UnnecessaryAnnotationValueElement") @ParameterType(value = "true|True|TRUE|false|False|FALSE|null|NULL") @@ -1152,7 +1154,6 @@ private void receive(String message, String clientDeviceId, String topicString, * @param clientDeviceId the user defined client device id * @param value the duration of time to wait for message * @param unit the time unit to wait - * @throws TimeoutException when matched message was not received in specified duration of time * @throws RuntimeException on internal errors * @throws InterruptedException then thread has been interrupted */ @@ -1167,7 +1168,6 @@ public void checkIsNotDisconnect(String clientDeviceId, int value, String unit) * @param clientDeviceId the user defined client device id * @param value the duration of time to wait for message * @param unit the time unit to wait - * @throws TimeoutException when matched message was not received in specified duration of time * @throws RuntimeException on internal errors * @throws InterruptedException then thread has been interrupted */