From 9177c1df75ae36b83c170f02eb5f0101526a6d3a Mon Sep 17 00:00:00 2001 From: Ana Albic Date: Thu, 17 Oct 2019 10:16:31 +0200 Subject: [PATCH] separated tests for job engine service - restart Signed-off-by: Ana Albic --- .travis.yml | 4 + ...nJobEngineServiceOfflineDeviceI9nTest.java | 36 + ...nJobEngineServiceOnlineDeviceI9nTest.java} | 5 +- ...ngineServiceRestartOnlineDeviceI9n.feature | 824 +---------------- ...ceRestartOnlineDeviceSecondPartI9n.feature | 825 ++++++++++++++++++ ...EngineServiceStartOfflineDeviceI9n.feature | 1 - 6 files changed, 888 insertions(+), 807 deletions(-) create mode 100644 qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOfflineDeviceI9nTest.java rename qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/{RunJobEngineServiceI9nTest.java => RunJobEngineServiceOnlineDeviceI9nTest.java} (90%) create mode 100644 qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature diff --git a/.travis.yml b/.travis.yml index b85df849b89..bf24711fa8b 100755 --- a/.travis.yml +++ b/.travis.yml @@ -93,6 +93,10 @@ jobs: script: - ./travis.sh $M2_HOME/bin/mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.options="--tags @jobEngineRestartOnlineDevice" verify - bash <(curl -s https://codecov.io/bash) + - stage: test + script: + - ./travis.sh $M2_HOME/bin/mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.options="--tags @jobEngineRestartOnlineDeviceSecondPart" verify + - bash <(curl -s https://codecov.io/bash) - stage: test script: - ./travis.sh $M2_HOME/bin/mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='org.eclipse.kapua.qa.markers.junit.JUnitTests' verify diff --git a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOfflineDeviceI9nTest.java b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOfflineDeviceI9nTest.java new file mode 100644 index 00000000000..6fded551e82 --- /dev/null +++ b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOfflineDeviceI9nTest.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2019 Eurotech and/or its affiliates and others + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eurotech - initial API and implementation + *******************************************************************************/ +package org.eclipse.kapua.integration.service.jobEngine; + +import cucumber.api.CucumberOptions; +import org.eclipse.kapua.qa.common.cucumber.CucumberWithProperties; +import org.junit.runner.RunWith; + +@RunWith(CucumberWithProperties.class) +@CucumberOptions( + features = { + "classpath:features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature", + "classpath:features/jobEngine/JobEngineServiceRestartOfflineDeviceI9n.feature" + }, + glue = { "org.eclipse.kapua.service.job.steps", + "org.eclipse.kapua.service.user.steps", + "org.eclipse.kapua.qa.common", + "org.eclipse.kapua.service.account.steps", + "org.eclipse.kapua.service.device.registry.steps", + }, + plugin = { "pretty", + "html:target/cucumber", + "json:target/cucumber.json" }, + strict = true, + monochrome = true) +public class RunJobEngineServiceOfflineDeviceI9nTest { +} diff --git a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOnlineDeviceI9nTest.java similarity index 90% rename from qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java rename to qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOnlineDeviceI9nTest.java index 599a025cd4f..95615382b65 100644 --- a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java +++ b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceOnlineDeviceI9nTest.java @@ -18,10 +18,9 @@ @RunWith(CucumberWithProperties.class) @CucumberOptions( features = { - "classpath:features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature", "classpath:features/jobEngine/JobEngineServiceStartOnlineDeviceI9n.feature", "classpath:features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature", - "classpath:features/jobEngine/JobEngineServiceRestartOfflineDeviceI9n.feature" + "classpath:features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature" }, glue = { "org.eclipse.kapua.service.job.steps", "org.eclipse.kapua.service.user.steps", @@ -34,5 +33,5 @@ "json:target/cucumber.json" }, strict = true, monochrome = true) -public class RunJobEngineServiceI9nTest { +public class RunJobEngineServiceOnlineDeviceI9nTest { } diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature index 3411bdd68b2..d4a771fd611 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature @@ -649,7 +649,7 @@ Feature: JobEngineService restart job tests with online device When I create a new step entity from the existing creator And I search the database for created job steps and I find 2 Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -755,7 +755,7 @@ Feature: JobEngineService restart job tests with online device And I search the database for created job steps and I find 2 Then No exception was thrown Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -763,7 +763,7 @@ Feature: JobEngineService restart job tests with online device And I search for the last job target in the database And I confirm the step index is 1 and status is "PROCESS_OK" Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -877,7 +877,7 @@ Feature: JobEngineService restart job tests with online device And I search the database for created job steps and I find 2 Then No exception was thrown And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -984,7 +984,7 @@ Feature: JobEngineService restart job tests with online device Then No exception was thrown And I search the database for created job steps and I find 2 And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -998,7 +998,7 @@ Feature: JobEngineService restart job tests with online device Then A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE And A bundle named com.google.guava with id 95 and version 19.0.0 is present and ACTIVE Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -1115,7 +1115,7 @@ Feature: JobEngineService restart job tests with online device Then No exception was thrown And I search the database for created job steps and I find 2 And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -1223,7 +1223,7 @@ Feature: JobEngineService restart job tests with online device Then No exception was thrown And I search the database for created job steps and I find 2 And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -1237,7 +1237,7 @@ Feature: JobEngineService restart job tests with online device And A bundle named org.eclipse.kura.linux.bluetooth with id 77 and version 1.0.300 is present and RESOLVED And A bundle named com.google.guava with id 95 and version 19.0.0 is present and ACTIVE Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -1323,402 +1323,6 @@ Feature: JobEngineService restart job tests with online device And Device status is "DISCONNECTED" And I logout - Scenario: Restarting A Job with valid Configuration Put Step And Step Index=0 For The First Time - Create a new job and set a connected KuraMock device as the job target. - Add a new valid Configuration Put step to the created job. Restart the job. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_OK - - Given I start the Kura Mock - When Device "is" connected - And I wait 1 seconds - Then Device status is "CONNECTED" - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - Then I create a new step entity from the existing creator - And I restart a job - And I wait 15 seconds - When I query for the job with the name "TestJob" - And I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - Then I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - And KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - Scenario: Restarting A Job with invalid Configuration Put Step And Step Index=0 For The First Time - Create a new job and set a connected KuraMock device as the job target. - Add a new invalid Configuration Put step to the created job. Restart the job. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_FAILED - - Given I start the Kura Mock - When Device "is" connected - And I wait 1 seconds - Then Device status is "CONNECTED" - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - Then I create a new step entity from the existing creator - And I restart a job - And I wait 15 seconds - When I query for the job with the name "TestJob" - And I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - Then I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - And KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - Scenario: Restarting A Job with valid Configuration Put Step And Step Index=0 For The Second Time - Create a new job and set a connected KuraMock device as the job target. - Add a new valid Configuration Put step to the created job. Restart the job two times. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_OK - - Given I start the Kura Mock - When Device "is" connected - And I wait 1 seconds - Then Device status is "CONNECTED" - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - Then I create a new step entity from the existing creator - And I restart a job - And I wait 15 seconds - When I query for the job with the name "TestJob" - And I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - Then I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then I restart a job - And I wait 15 seconds - When I query for the job with the name "TestJob" - And I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - Then I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - And KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - Scenario: Restarting A Job with invalid Configuration Put Step And Step Index=0 For The Second Time - Create a new job and set a connected KuraMock device as the job target. - Add a new invalid Configuration Put step to the created job. Restart the job two times. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_FAILED - - Given I start the Kura Mock - When Device "is" connected - And I wait 1 seconds - Then Device status is "CONNECTED" - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - Then I create a new step entity from the existing creator - And I restart a job - And I wait 15 seconds - When I query for the job with the name "TestJob" - And I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - Then I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then I restart a job - And I wait 15 seconds - When I query for the job with the name "TestJob" - And I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - Then I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - And KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - # ******************************************************* - # * Restarting a job with one Target and multiple Steps * - # ******************************************************* - - Scenario: Restarting Job With Valid Configuration Put And Bundle Start Steps And Step Index=0 For The First Time - Create a new job. Set a connected Kura Mock device as a job target. - Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job. - After the executed job is finished, the step index of executed targets should - be 1 and the status PROCESS_OK - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - When I start the Kura Mock - And Device "is" connected - And I wait 1 second - Then Device status is "CONNECTED" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | 34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 1 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE - When KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - Scenario: Restarting Job With Invalid Configuration Put And Bundle Start Steps And Step Index=0 For The First Time - Create a new job. Set a connected Kura Mock device as a job target. - Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job. - After the executed job is finished, the step index of executed targets should - be 0 and the status PROCESS_FAILED - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - When I start the Kura Mock - And Device "is" connected - And I wait 1 second - Then Device status is "CONNECTED" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | #34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - When KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - Scenario: Restarting Job With Valid Configuration Put And Bundle Start Steps And Step Index=0 For The Second Time - Create a new job. Set a connected Kura Mock device as a job target. - Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job two times. - After the executed job is finished, the step index of executed targets should - be 1 and the status PROCESS_OK - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - When I start the Kura Mock - And Device "is" connected - And I wait 1 second - Then Device status is "CONNECTED" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | 34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 1 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 1 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE - When KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - - Scenario: Restarting Job With Invalid Configuration Put And Bundle Start Steps And Step Index=0 For The Second Time - Create a new job. Set a connected Kura Mock device as a job target. - Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job two times. - After the executed job is finished, the step index of executed targets should - be 0 and the status PROCESS_FAILED - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - When I start the Kura Mock - And Device "is" connected - And I wait 1 second - Then Device status is "CONNECTED" - And I get the KuraMock device - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And A new job target item - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | #34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - When KuraMock is disconnected - And I wait 1 seconds - And Device status is "DISCONNECTED" - And I logout - # ******************************************************* # * Restarting a job with multiple Targets and one Step * # ******************************************************* @@ -1831,7 +1435,7 @@ Feature: JobEngineService restart job tests with online device | timeout | java.lang.Long | 10000 | And I create a new step entity from the existing creator Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -1839,7 +1443,7 @@ Feature: JobEngineService restart job tests with online device And I search for the last job target in the database And I confirm the step index is 0 and status is "PROCESS_OK" Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -2020,7 +1624,7 @@ Feature: JobEngineService restart job tests with online device When I create a new step entity from the existing creator Then No exception was thrown And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -2033,7 +1637,7 @@ Feature: JobEngineService restart job tests with online device And Bundles are requested Then A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -2221,7 +1825,7 @@ Feature: JobEngineService restart job tests with online device When I create a new step entity from the existing creator Then No exception was thrown And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -2234,7 +1838,7 @@ Feature: JobEngineService restart job tests with online device Then Bundles are requested And A bundle named org.eclipse.kura.linux.bluetooth with id 77 and version 1.0.300 is present and RESOLVED Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -2309,176 +1913,6 @@ Feature: JobEngineService restart job tests with online device And Device status is "DISCONNECTED" And I logout - Scenario: Restarting A Job With Valid Configuration Put Step, Multiple Devices and Step Index=0 For The First Time - Create a new job and set a connected KuraMock devices as the job target. - Add a new valid Configuration Put step to the created job. Restart the job. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_OK - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - And KuraMock is disconnected - And I logout - - Scenario: Restarting a job with invalid Configuration Put Step, Multiple Devices And Step Index=0 For The First Time - Create a new job and set a connected KuraMock devices as the job target. - Add a new invalid Configuration Put step to the created job. Restart the job. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_FAILED - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And I wait 1 seconds - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - And KuraMock is disconnected - And I logout - - Scenario: Restarting A Job With Valid Configuration Put Step, Multiple Devices And Step Index=0 For The Second Time - Create a new job and set a connected KuraMock devices as the job target. - Add a new valid Configuration Put step to the created job. Restart the job two times. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_OK - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - And KuraMock is disconnected - And I logout - - Scenario: Restarting a job with invalid Configuration Put, Multiple Devices And Step Index=0 For The Second Time - Create a new job and set a connected KuraMock devices as the job target. - Add a new invalid Configuration Put step to the created job. Restart the job two times. - After the executed job is finished, the executed target's step index should - be 0 and the status PROCESS_FAILED - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And I wait 1 seconds - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - And KuraMock is disconnected - And I logout - # ************************************************************* # * Restarting a job with multiple Targets and multiple Steps * # ************************************************************* @@ -2626,7 +2060,7 @@ Feature: JobEngineService restart job tests with online device And I search the database for created job steps and I find 2 Then No exception was thrown Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -2634,7 +2068,7 @@ Feature: JobEngineService restart job tests with online device And I search for the last job target in the database And I confirm the step index is 1 and status is "PROCESS_OK" Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -2750,7 +2184,7 @@ Feature: JobEngineService restart job tests with online device And I search the database for created job steps and I find 2 Then No exception was thrown And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -3096,7 +2530,7 @@ Feature: JobEngineService restart job tests with online device Then No exception was thrown And I search the database for created job steps and I find 2 And I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 1 @@ -3110,7 +2544,7 @@ Feature: JobEngineService restart job tests with online device And A bundle named org.eclipse.kura.linux.bluetooth with id 77 and version 1.0.300 is present and RESOLVED And A bundle named com.google.guava with id 95 and version 19.0.0 is present and ACTIVE Then I restart a job - And I wait 15 seconds + And I wait 30 seconds Given I query for the job with the name "TestJob" When I query for the execution items for the current job Then I count 2 @@ -3196,223 +2630,7 @@ Feature: JobEngineService restart job tests with online device And Device status is "DISCONNECTED" And I logout - Scenario: Restarting job with valid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The First Time - Create a new job. Set a connected Kura Mock devices as a job target. - Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job. - After the executed job is finished, the step index of executed targets should - be 1 and the status PROCESS_OK - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | 34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 1 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE - When KuraMock is disconnected - And I logout - - Scenario: Restarting job with invalid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The First Time - Create a new job. Set connected Kura Mock devices as a job target. - Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job. - After the executed job is finished, the step index of executed targets should - be 0 and the status PROCESS_FAILED - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | #34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - When KuraMock is disconnected - And I logout - - Scenario: Restarting job with valid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The Second Time - Create a new job. Set a connected Kura Mock devices as a job target. - Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job two times. - After the executed job is finished, the step index of executed targets should - be 1 and the status PROCESS_OK - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | 34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 1 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 1 and status is "PROCESS_OK" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE - When KuraMock is disconnected - And I logout - - Scenario: Restarting job with invalid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The Second Time - Create a new job. Set connected Kura Mock devices as a job target. - Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job two times. - After the executed job is finished, the step index of executed targets should - be 0 and the status PROCESS_FAILED - - Given I start the Kura Mock - Then I add 2 devices to Kura Mock - And Devices "are" connected - And I login as user with name "kapua-sys" and password "kapua-password" - And I select account "kapua-sys" - And I get the KuraMock devices - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Given I create a job with the name "TestJob" - And I add targets to job - When I count the targets in the current scope - Then I count 2 - And Search for step definition with the name "Configuration Put" - And A regular step creator with the name "TestStep1" and the following properties - | name | type | value | - | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - Then Search for step definition with the name "Bundle Start" - And A regular step creator with the name "TestStep2" and the following properties - | name | type | value | - | bundleId | java.lang.String | #34 | - | timeout | java.lang.Long | 10000 | - When I create a new step entity from the existing creator - And I search the database for created job steps and I find 2 - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 1 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - Then I restart a job - And I wait 15 seconds - Given I query for the job with the name "TestJob" - When I query for the execution items for the current job - Then I count 2 - And I confirm the executed job is finished - And I search for the last job target in the database - And I confirm the step index is 0 and status is "PROCESS_FAILED" - Then Configuration is requested - And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 - Then Bundles are requested - And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED - When KuraMock is disconnected - And I logout - - Scenario: Stop broker after all scenarios + Scenario: Stop broker after all scenarios Given Stop Broker Scenario: Stop event broker for all scenarios diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature new file mode 100644 index 00000000000..c90e0b4f882 --- /dev/null +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature @@ -0,0 +1,825 @@ +############################################################################### +# Copyright (c) 2019 Eurotech and/or its affiliates and others +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Eurotech - initial API and implementation +############################################################################### +@jobEngineRestartOnlineDeviceSecondPart +@integration + +Feature: JobEngineService restart job tests with online device - second part + + Scenario: Set environment variables + Given System property "broker.ip" with value "localhost" + And System property "commons.db.connection.host" with value "localhost" + + Scenario: Start event broker for all scenarios + Given Start Event Broker + + Scenario: Start broker for all scenarios + Given Start Broker + + # ************************************************* + # * Restarting a job with one Target and one Step * + # ************************************************* + + Scenario: Restarting A Job with valid Configuration Put Step And Step Index=0 For The First Time + Create a new job and set a connected KuraMock device as the job target. + Add a new valid Configuration Put step to the created job. Restart the job. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_OK + + Given I start the Kura Mock + When Device "is" connected + And I wait 1 seconds + Then Device status is "CONNECTED" + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + Then I create a new step entity from the existing creator + And I restart a job + And I wait 15 seconds + When I query for the job with the name "TestJob" + And I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + Then I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + And KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + Scenario: Restarting A Job with invalid Configuration Put Step And Step Index=0 For The First Time + Create a new job and set a connected KuraMock device as the job target. + Add a new invalid Configuration Put step to the created job. Restart the job. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_FAILED + + Given I start the Kura Mock + When Device "is" connected + And I wait 1 seconds + Then Device status is "CONNECTED" + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + Then I create a new step entity from the existing creator + And I restart a job + And I wait 15 seconds + When I query for the job with the name "TestJob" + And I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + Then I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + And KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + Scenario: Restarting A Job with valid Configuration Put Step And Step Index=0 For The Second Time + Create a new job and set a connected KuraMock device as the job target. + Add a new valid Configuration Put step to the created job. Restart the job two times. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_OK + + Given I start the Kura Mock + When Device "is" connected + And I wait 1 seconds + Then Device status is "CONNECTED" + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + Then I create a new step entity from the existing creator + And I restart a job + And I wait 15 seconds + When I query for the job with the name "TestJob" + And I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + Then I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then I restart a job + And I wait 15 seconds + When I query for the job with the name "TestJob" + And I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + Then I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + And KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + Scenario: Restarting A Job with invalid Configuration Put Step And Step Index=0 For The Second Time + Create a new job and set a connected KuraMock device as the job target. + Add a new invalid Configuration Put step to the created job. Restart the job two times. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_FAILED + + Given I start the Kura Mock + When Device "is" connected + And I wait 1 seconds + Then Device status is "CONNECTED" + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + Then I create a new step entity from the existing creator + And I restart a job + And I wait 15 seconds + When I query for the job with the name "TestJob" + And I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + Then I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then I restart a job + And I wait 15 seconds + When I query for the job with the name "TestJob" + And I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + Then I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + And KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + # ******************************************************* + # * Restarting a job with one Target and multiple Steps * + # ******************************************************* + + Scenario: Restarting Job With Valid Configuration Put And Bundle Start Steps And Step Index=0 For The First Time + Create a new job. Set a connected Kura Mock device as a job target. + Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job. + After the executed job is finished, the step index of executed targets should + be 1 and the status PROCESS_OK + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + When I start the Kura Mock + And Device "is" connected + And I wait 1 second + Then Device status is "CONNECTED" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | 34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 1 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE + When KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + Scenario: Restarting Job With Invalid Configuration Put And Bundle Start Steps And Step Index=0 For The First Time + Create a new job. Set a connected Kura Mock device as a job target. + Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job. + After the executed job is finished, the step index of executed targets should + be 0 and the status PROCESS_FAILED + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + When I start the Kura Mock + And Device "is" connected + And I wait 1 second + Then Device status is "CONNECTED" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | #34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + When KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + Scenario: Restarting Job With Valid Configuration Put And Bundle Start Steps And Step Index=0 For The Second Time + Create a new job. Set a connected Kura Mock device as a job target. + Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job two times. + After the executed job is finished, the step index of executed targets should + be 1 and the status PROCESS_OK + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + When I start the Kura Mock + And Device "is" connected + And I wait 1 second + Then Device status is "CONNECTED" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | 34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 30 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 1 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE + Then I restart a job + And I wait 30 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 1 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE + When KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + Scenario: Restarting Job With Invalid Configuration Put And Bundle Start Steps And Step Index=0 For The Second Time + Create a new job. Set a connected Kura Mock device as a job target. + Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job two times. + After the executed job is finished, the step index of executed targets should + be 0 and the status PROCESS_FAILED + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + When I start the Kura Mock + And Device "is" connected + And I wait 1 second + Then Device status is "CONNECTED" + And I get the KuraMock device + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And A new job target item + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | #34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + When KuraMock is disconnected + And I wait 1 seconds + And Device status is "DISCONNECTED" + And I logout + + # ******************************************************* + # * Restarting a job with multiple Targets and one Step * + # ******************************************************* + + Scenario: Restarting A Job With Valid Configuration Put Step, Multiple Devices and Step Index=0 For The First Time + Create a new job and set a connected KuraMock devices as the job target. + Add a new valid Configuration Put step to the created job. Restart the job. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_OK + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + And KuraMock is disconnected + And I logout + + Scenario: Restarting a job with invalid Configuration Put Step, Multiple Devices And Step Index=0 For The First Time + Create a new job and set a connected KuraMock devices as the job target. + Add a new invalid Configuration Put step to the created job. Restart the job. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_FAILED + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And I wait 1 seconds + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + And KuraMock is disconnected + And I logout + + Scenario: Restarting A Job With Valid Configuration Put Step, Multiple Devices And Step Index=0 For The Second Time + Create a new job and set a connected KuraMock devices as the job target. + Add a new valid Configuration Put step to the created job. Restart the job two times. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_OK + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + And KuraMock is disconnected + And I logout + + Scenario: Restarting a job with invalid Configuration Put, Multiple Devices And Step Index=0 For The Second Time + Create a new job and set a connected KuraMock devices as the job target. + Add a new invalid Configuration Put step to the created job. Restart the job two times. + After the executed job is finished, the executed target's step index should + be 0 and the status PROCESS_FAILED + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And I wait 1 seconds + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + And KuraMock is disconnected + And I logout + + # ************************************************************* + # * Restarting a job with multiple Targets and multiple Steps * + # ************************************************************* + + Scenario: Restarting job with valid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The First Time + Create a new job. Set a connected Kura Mock devices as a job target. + Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job. + After the executed job is finished, the step index of executed targets should + be 1 and the status PROCESS_OK + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | 34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 30 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 1 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE + When KuraMock is disconnected + And I logout + + Scenario: Restarting job with invalid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The First Time + Create a new job. Set connected Kura Mock devices as a job target. + Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job. + After the executed job is finished, the step index of executed targets should + be 0 and the status PROCESS_FAILED + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | #34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + When KuraMock is disconnected + And I logout + + Scenario: Restarting job with valid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The Second Time + Create a new job. Set a connected Kura Mock devices as a job target. + Add a new valid Configuration Put and Bundle Start steps to the created job. Restart the job two times. + After the executed job is finished, the step index of executed targets should + be 1 and the status PROCESS_OK + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | 34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 30 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 1 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE + Then I restart a job + And I wait 30 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 1 and status is "PROCESS_OK" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 10 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and ACTIVE + When KuraMock is disconnected + And I logout + + Scenario: Restarting job with invalid Configuration Put and Bundle Start Steps, Multiple Devices And Step Index=0 For The Second Time + Create a new job. Set connected Kura Mock devices as a job target. + Add a new invalid Configuration Put and Bundle Start steps to the created job. Restart the job two times. + After the executed job is finished, the step index of executed targets should + be 0 and the status PROCESS_FAILED + + Given I start the Kura Mock + Then I add 2 devices to Kura Mock + And Devices "are" connected + And I login as user with name "kapua-sys" and password "kapua-password" + And I select account "kapua-sys" + And I get the KuraMock devices + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Given I create a job with the name "TestJob" + And I add targets to job + When I count the targets in the current scope + Then I count 2 + And Search for step definition with the name "Configuration Put" + And A regular step creator with the name "TestStep1" and the following properties + | name | type | value | + | configuration | org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration | org.eclipse.kura.clock.ClockService>0.pool.ntp.orgjava-ntp12303600truetrue1000010| + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + Then Search for step definition with the name "Bundle Start" + And A regular step creator with the name "TestStep2" and the following properties + | name | type | value | + | bundleId | java.lang.String | #34 | + | timeout | java.lang.Long | 10000 | + When I create a new step entity from the existing creator + And I search the database for created job steps and I find 2 + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 1 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + Then I restart a job + And I wait 15 seconds + Given I query for the job with the name "TestJob" + When I query for the execution items for the current job + Then I count 2 + And I confirm the executed job is finished + And I search for the last job target in the database + And I confirm the step index is 0 and status is "PROCESS_FAILED" + Then Configuration is requested + And A Configuration named org.eclipse.kura.clock.ClockService has property clock.ntp.retry.interval with value 5 + Then Bundles are requested + And A bundle named slf4j.api with id 34 and version 1.7.21 is present and RESOLVED + When KuraMock is disconnected + And I logout + + Scenario: Stop broker after all scenarios + Given Stop Broker + + Scenario: Stop event broker for all scenarios + Given Stop Event Broker \ No newline at end of file diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature index 594b2b8328c..b0ebae23108 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature @@ -300,7 +300,6 @@ Then I count 1 And I confirm the executed job is finished And I search for the last job target in the database - And I wait 3 seconds And I confirm the step index is 0 and status is "PROCESS_FAILED" When I start the Kura Mock And Device "is" connected