Skip to content

Commit

Permalink
Moved test of 3620 from DeviceService feature file to DeviceBroker be…
Browse files Browse the repository at this point in the history
…cause they require a running broker

Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Nov 24, 2022
1 parent e515bf6 commit 264cf4e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,36 @@ Feature: Device Broker Integration
And I logout
And Device death message is sent

Scenario: Creating a device with disabled status and trying to connect to the broker
Login as kapua-sys, create a device with its status set to DISABLED.
Then, trying to connect to the broker with a client who's client id equals to the created
device. Should result in an authentication failure.

When I login as user with name "kapua-sys" and password "kapua-password"
And I create a device with parameters
| clientId | displayName | modelId | serialNumber | status | scopeId |
| dev-123 | dply-Name_123@#$% | ReliaGate 10-20 | 12541234ABC | DISABLED | 1 |
Then No exception was thrown
Then I logout
Given I expect the exception "MqttSecurityException" with the text "Not authorized to connect"
When Client with name "dev-123" with client id "dev-123" user "kapua-broker" password "kapua-password" is connected
Then An exception was thrown

Scenario: Creating a device with enabled status and trying to connect to the broker
Login as kapua-sys, create a device with its status set to ENABLED.
Then, trying to connect to the broker with a client who's client id equals to the created
device. Should not result in an authentication failure.

When I login as user with name "kapua-sys" and password "kapua-password"
And I create a device with parameters
| clientId | displayName | modelId | serialNumber | status | scopeId |
| dev-123 | dply-Name_123@#$% | ReliaGate 10-20 | 12541234ABC | ENABLED | 1 |
Then No exception was thrown
Then I logout
When Client with name "dev-12" with client id "dev-12" user "kapua-broker" password "kapua-password" is connected
Then No exception was thrown


Scenario: Stop broker after all scenarios

Given Stop Broker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,35 +586,6 @@ Scenario: Init Security Context for all scenarios
Then No exception was thrown
Then I logout

Scenario: Creating a device with disabled status and trying to connect to the broker.
Login as kapua-sys, create a device with its status set to DISABLED.
Then, trying to connect to the broker with a client who's client id equals to the created
device. Should result in an authentication failure.

When I login as user with name "kapua-sys" and password "kapua-password"
And I create a device with parameters
| clientId | displayName | modelId | serialNumber | status | scopeId |
| dev-123 | dply-Name_123@#$% | ReliaGate 10-20 | 12541234ABC | DISABLED | 1 |
Then No exception was thrown
Then I logout
Given I expect the exception "MqttSecurityException" with the text "Not authorized to connect"
When Client with name "dev-123" with client id "dev-123" user "kapua-broker" password "kapua-password" is connected
Then An exception was thrown

Scenario: Creating a device with enabled status and trying to connect to the broker.
Login as kapua-sys, create a device with its status set to ENABLED.
Then, trying to connect to the broker with a client who's client id equals to the created
device. Should not result in an authentication failure.

When I login as user with name "kapua-sys" and password "kapua-password"
And I create a device with parameters
| clientId | displayName | modelId | serialNumber | status | scopeId |
| dev-123 | dply-Name_123@#$% | ReliaGate 10-20 | 12541234ABC | ENABLED | 1 |
Then No exception was thrown
Then I logout
When Client with name "dev-12" with client id "dev-12" user "kapua-broker" password "kapua-password" is connected
Then No exception was thrown

Scenario: Creating A Device With Enabled Status
Login as kapua-sys, go to devices, create a device with its status set to ENABLED.
Kapua should not return errors.
Expand Down

0 comments on commit 264cf4e

Please sign in to comment.