From 2523285464f8d1280f086aa41ed16b462442f7a1 Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Fri, 20 Dec 2024 16:09:39 +0100 Subject: [PATCH] :recycle: [Test] Added new set of test cases to test JobEngine Device Management Keystore Target Processors Signed-off-by: Alberto Codutti --- .github/workflows/kapua-ci.yaml | 2 +- ...t.java => RunJobEngineServiceI9nTest.java} | 9 +- ...ServiceKeystoreStepDefinitionsI9nTest.java | 38 ----- ...eServiceKeystoreStepDefinitionsI9n.feature | 156 ------------------ .../JobEngineServiceOperations.feature | 27 ++- ...bEngineServiceProcessorKeystoreI9n.feature | 108 ++++++++++++ ...gineServiceRestartOfflineDeviceI9n.feature | 1 - ...ngineServiceRestartOnlineDeviceI9n.feature | 1 - ...ceRestartOnlineDeviceSecondPartI9n.feature | 1 - ...EngineServiceStartOfflineDeviceI9n.feature | 1 - ...bEngineServiceStartOnlineDeviceI9n.feature | 1 - ...obEngineServiceStopOnlineDeviceI9n.feature | 1 - 12 files changed, 127 insertions(+), 219 deletions(-) rename qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/{RunJobEngineService9nTest.java => RunJobEngineServiceI9nTest.java} (77%) delete mode 100644 qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/stepDefinitions/RunJobEngineServiceKeystoreStepDefinitionsI9nTest.java delete mode 100644 qa/integration/src/test/resources/features/jobEngine/JobEngineServiceKeystoreStepDefinitionsI9n.feature create mode 100644 qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 7fb3b56c726..71619d91923 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -182,7 +182,7 @@ jobs: uses: actions/checkout@v4 - uses: ./.github/actions/runTestsTaggedAs with: - tag: '@jobEngineOperations' + tag: '@jobEngine' needs-docker-images: 'true' test-jobsIntegration: needs: build diff --git a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineService9nTest.java b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java similarity index 77% rename from qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineService9nTest.java rename to qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java index 4f277d8da84..8fa5eda1dfc 100644 --- a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineService9nTest.java +++ b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/RunJobEngineServiceI9nTest.java @@ -19,7 +19,8 @@ @RunWith(Cucumber.class) @CucumberOptions( features = { - "classpath:features/jobEngine/JobEngineServiceOperations.feature", +// "classpath:features/jobEngine/JobEngineServiceOperations.feature", + "classpath:features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature", }, glue = { "org.eclipse.kapua.service.job.steps", @@ -31,9 +32,9 @@ }, plugin = { "pretty", - "html:target/cucumber/JobEngineServiceOfflineDeviceI9n", - "json:target/JobEngineServiceOfflineDeviceI9n_cucumber.json" + "html:target/cucumber/RunJobEngineServiceI9n", + "json:target/RunJobEngineServiceI9n_cucumber.json" }, monochrome = true) -public class RunJobEngineService9nTest { +public class RunJobEngineServiceI9nTest { } diff --git a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/stepDefinitions/RunJobEngineServiceKeystoreStepDefinitionsI9nTest.java b/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/stepDefinitions/RunJobEngineServiceKeystoreStepDefinitionsI9nTest.java deleted file mode 100644 index 86b85ee8fcf..00000000000 --- a/qa/integration/src/test/java/org/eclipse/kapua/integration/service/jobEngine/stepDefinitions/RunJobEngineServiceKeystoreStepDefinitionsI9nTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Eurotech - initial API and implementation - *******************************************************************************/ -package org.eclipse.kapua.integration.service.jobEngine.stepDefinitions; - -import org.junit.runner.RunWith; - -import io.cucumber.junit.Cucumber; -import io.cucumber.junit.CucumberOptions; - -@RunWith(Cucumber.class) -@CucumberOptions( - features = { - "classpath:features/jobEngine/JobEngineServiceKeystoreStepDefinitionsI9n.feature" - }, - glue = { - "org.eclipse.kapua.qa.common", - "org.eclipse.kapua.qa.integration.steps", - "org.eclipse.kapua.service.job.steps", - "org.eclipse.kapua.service.user.steps", - "org.eclipse.kapua.service.account.steps", - "org.eclipse.kapua.service.device.registry.steps", - }, - plugin = {"pretty", - "html:target/cucumber/JobEngineServiceKeystoreStepDefinitionsI9n", - "json:target/JobEngineServiceKeystoreStepDefinitionsI9n_cucumber.json"}, - monochrome = true) -public class RunJobEngineServiceKeystoreStepDefinitionsI9nTest { -} diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceKeystoreStepDefinitionsI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceKeystoreStepDefinitionsI9n.feature deleted file mode 100644 index f276d267cba..00000000000 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceKeystoreStepDefinitionsI9n.feature +++ /dev/null @@ -1,156 +0,0 @@ -############################################################################### -# Copyright (c) 2021, 2024 Eurotech and/or its affiliates and others -# -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Eurotech - initial API and implementation -############################################################################### -@env_docker -@it -@jobEngine -@jobEngineStepDefinitions -@deviceManagementKeystore - -Feature: Job Engine Service - Keystore Step Definitions - - @setup - Scenario: Setup test resources - Given Init Security Context - And Start Docker environment with resources - | db | - | events-broker | - | job-engine | - | message-broker | - | broker-auth-service | - | consumer-lifecycle | - - # - # Tests - # - - Scenario: Running a Job with Keystore Certificate Create Step Definition - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I start the Kura Mock - When Device is connected within 10 seconds - Then Device status is "CONNECTED" within 10 seconds - And I select account "kapua-sys" - And I get the KuraMock device after 5 seconds - When I search for events from device "rpione3" in account "kapua-sys" I find 1 event within 30 seconds - And The type of the last event is "BIRTH" - Given I create a job with the name "TestJob - Keystore Steps" - And I create a new job target item - And Search for step definition with the name "Keystore Certificate Create" - And I prepare a JobStepCreator with the name "Keystore Certificate Create" and the following properties - | name | type | value | - | keystoreId | java.lang.String | SSLKeystore | - | alias | java.lang.String | qaCertificate | - | certificate | java.lang.String | -----BEGIN CERTIFICATE-----\nMIIFVzCCBD+gAwIBAgISA38CzQctm3+HkSyZPnDL8TFsMA0GCSqGSIb3DQEBCwUA\nMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD\nExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTA3MTkxMDIxMTdaFw0x\nOTEwMTcxMDIxMTdaMBsxGTAXBgNVBAMTEG1xdHQuZWNsaXBzZS5vcmcwggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQnt6ZBEZ/vDG0JLqVB45lO6xlLazt\nYpEqZlGBket6PtjUGLdE2XivTpjtUkERS1cvPBqT1DH/yEZ1CU7iT/gfZtZotR0c\nqEMogSGkmrN1sAV6Eb+xGT3sPm1WFeKZqKdzAScdULoweUgwbNXa9kAB1uaSYBTe\ncq2ynfxBKWL/7bVtoeXUOyyaiIxVPTYz5XgpjSUB+9ML/v/+084XhIKA/avGPOSi\nRHOB+BsqTGyGhDgAHF+CDrRt8U1preS9AKXUvZ0aQL+djV8Y5nXPQPR8c2wplMwL\n5W/YMrM/dBm64vclKQLVPyEPqMOLMqcf+LkfQi6WOH+JByJfywAlme6jAgMBAAGj\nggJ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Jz6qwzixhqg30tf6siOs9yrpHpPnDnbRrahbwnYTpm6JP0lK53GeFec4ckNi3\nzT5+hEVOZ4JYPb3xVXkzIjSWmnDVbwC9MFtRaER9MhugKmiAp8SRLbylD0GKOhSB\n2BDf6JrzhIddKxQ75KgMZE6FQaC3Bz1DFyrj\n-----END CERTIFICATE----- | - | timeout | java.lang.Long | 10000 | - When I create a new JobStep from the existing creator - Then No exception was thrown - And I start a job - And I confirm job target has step index 0 and status "PROCESS_OK" within 31 seconds - And I query for the job with the name "TestJob - Keystore Steps" and I count 1 execution item and I confirm the executed job is finished within 20 seconds - And I search for events from device "rpione3" in account "kapua-sys" I find 2 events within 30 seconds - And KuraMock is disconnected - And I logout - - Scenario: Running a Job with Keystore Keypair Create Step Definition - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I start the Kura Mock - When Device is connected within 10 seconds - Then Device status is "CONNECTED" within 10 seconds - And I select account "kapua-sys" - And I get the KuraMock device after 5 seconds - When I search for events from device "rpione3" in account "kapua-sys" I find 1 event within 30 seconds - And The type of the last event is "BIRTH" - Given I create a job with the name "TestJob - Keystore Steps" - And I create a new job target item - And Search for step definition with the name "Keystore Keypair Create" - And I prepare a JobStepCreator with the name "Keystore Keypair Create" and the following properties - | name | type | value | - | keystoreId | java.lang.String | SSLKeystore | - | alias | java.lang.String | qaKeypair | - | size | java.lang.Integer | 4096 | - | algorithm | java.lang.String | RSA | - | signatureAlgorithm | java.lang.String | SHA256withRSA | - | attributes | java.lang.String | CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US | - | timeout | java.lang.Long | 10000 | - When I create a new JobStep from the existing creator - Then No exception was thrown - And I start a job - And I confirm job target has step index 0 and status "PROCESS_OK" within 31 seconds - And I query for the job with the name "TestJob - Keystore Steps" and I count 1 execution item and I confirm the executed job is finished within 20 seconds - And I search for events from device "rpione3" in account "kapua-sys" I find 2 events within 30 seconds - And KuraMock is disconnected - And I logout - - Scenario: Running a Job with Keystore Item Delete Step Definition - Multi-step job with a Keystore Certificate Install and Ketstore Keypair Create and then - the deletion of those two new added Keystore Items - - Given I login as user with name "kapua-sys" and password "kapua-password" - And I start the Kura Mock - When Device is connected within 10 seconds - Then Device status is "CONNECTED" within 10 seconds - And I select account "kapua-sys" - And I get the KuraMock device after 5 seconds - When I search for events from device "rpione3" in account "kapua-sys" I find 1 event within 30 seconds - And The type of the last event is "BIRTH" - Given I create a job with the name "TestJob - Keystore Steps" - And I create a new job target item - And Search for step definition with the name "Keystore Certificate Create" - And I prepare a JobStepCreator with the name "Keystore Certificate Create" and the following properties - | name | type | value | - | keystoreId | java.lang.String | SSLKeystore | - | alias | java.lang.String | qaCertificate | - | certificate | java.lang.String | -----BEGIN CERTIFICATE-----\nMIIFVzCCBD+gAwIBAgISA38CzQctm3+HkSyZPnDL8TFsMA0GCSqGSIb3DQEBCwUA\nMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD\nExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTA3MTkxMDIxMTdaFw0x\nOTEwMTcxMDIxMTdaMBsxGTAXBgNVBAMTEG1xdHQuZWNsaXBzZS5vcmcwggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQnt6ZBEZ/vDG0JLqVB45lO6xlLazt\nYpEqZlGBket6PtjUGLdE2XivTpjtUkERS1cvPBqT1DH/yEZ1CU7iT/gfZtZotR0c\nqEMogSGkmrN1sAV6Eb+xGT3sPm1WFeKZqKdzAScdULoweUgwbNXa9kAB1uaSYBTe\ncq2ynfxBKWL/7bVtoeXUOyyaiIxVPTYz5XgpjSUB+9ML/v/+084XhIKA/avGPOSi\nRHOB+BsqTGyGhDgAHF+CDrRt8U1preS9AKXUvZ0aQL+djV8Y5nXPQPR8c2wplMwL\n5W/YMrM/dBm64vclKQLVPyEPqMOLMqcf+LkfQi6WOH+JByJfywAlme6jAgMBAAGj\nggJkMIICYDAOBgNVHQ8BA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yrpHpPnDnbRrahbwnYTpm6JP0lK53GeFec4ckNi3\nzT5+hEVOZ4JYPb3xVXkzIjSWmnDVbwC9MFtRaER9MhugKmiAp8SRLbylD0GKOhSB\n2BDf6JrzhIddKxQ75KgMZE6FQaC3Bz1DFyrj\n-----END CERTIFICATE----- | - | timeout | java.lang.Long | 10000 | - When I create a new JobStep from the existing creator - Then No exception was thrown - And Search for step definition with the name "Keystore Keypair Create" - And I prepare a JobStepCreator with the name "Keystore Keypair Create" and the following properties - | name | type | value | - | keystoreId | java.lang.String | SSLKeystore | - | alias | java.lang.String | qaKeypair | - | size | java.lang.Integer | 4096 | - | algorithm | java.lang.String | RSA | - | signatureAlgorithm | java.lang.String | SHA256withRSA | - | attributes | java.lang.String | CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US | - | timeout | java.lang.Long | 10000 | - When I create a new JobStep from the existing creator - Then No exception was thrown - And Search for step definition with the name "Keystore Item Delete" - And I prepare a JobStepCreator with the name "Keystore Keypair Delete Keypair" and the following properties - | name | type | value | - | keystoreId | java.lang.String | SSLKeystore | - | alias | java.lang.String | qaKeypair | - | timeout | java.lang.Long | 10000 | - When I create a new JobStep from the existing creator - Then No exception was thrown - And Search for step definition with the name "Keystore Item Delete" - And I prepare a JobStepCreator with the name "Keystore Keypair Delete Certificate" and the following properties - | name | type | value | - | keystoreId | java.lang.String | SSLKeystore | - | alias | java.lang.String | qaCertificate | - | timeout | java.lang.Long | 10000 | - When I create a new JobStep from the existing creator - Then No exception was thrown - And I start a job - And I confirm job target has step index 3 and status "PROCESS_OK" within 31 seconds - And I query for the job with the name "TestJob - Keystore Steps" and I count 1 execution item and I confirm the executed job is finished within 20 seconds - And I search for events from device "rpione3" in account "kapua-sys" I find 5 events within 30 seconds - And KuraMock is disconnected - And I logout - - @teardown - Scenario: Tear down test resources - Given Stop Docker environment - And Clean Locator Instance \ No newline at end of file diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceOperations.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceOperations.feature index a896428cadf..4b35a73a19b 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceOperations.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceOperations.feature @@ -15,9 +15,8 @@ @jobEngine @jobEngineOperations -Feature: JobEngineService stop job tests with online device - Job Engine Service test scenarios for stopping job. This feature file contains scenarios for stopping job with one target and one step, - one target and multiple steps, multiple targets and one step and multiple targets and multiple steps. +Feature: Job Engine Service - Operations + Job Engine Service tests for basic operations @setup Scenario: Setup test resources @@ -30,7 +29,7 @@ Feature: JobEngineService stop job tests with online device | broker-auth-service | | consumer-lifecycle | - Scenario: Start a Job - Without JobTarget + Scenario: Start - Without JobTarget Given I login as user with name "kapua-sys" and password "kapua-password" And I create a job with the name "Test Job - Empty Targets" @@ -38,7 +37,7 @@ Feature: JobEngineService stop job tests with online device And I start a job And An exception was thrown - Scenario: Start a Job - Without JobStep + Scenario: Start - Without JobStep Given I login as user with name "kapua-sys" and password "kapua-password" And I create a device with name "Test Target" @@ -49,7 +48,7 @@ Feature: JobEngineService stop job tests with online device And I start a job And An exception was thrown - Scenario: Start a Job - JobTarget ok + Scenario: Start - JobTarget ok Given I login as user with name "kapua-sys" and password "kapua-password" And I start the Kura Mock @@ -69,7 +68,7 @@ Feature: JobEngineService stop job tests with online device Then I confirm that job has 1 job execution And I confirm that job target in job has step index 0 and status "PROCESS_OK" - Scenario: Start a Job - JobTarget failed + Scenario: Start - JobTarget failed Given I login as user with name "kapua-sys" and password "kapua-password" And I create a device with name "Test Target" @@ -87,7 +86,7 @@ Feature: JobEngineService stop job tests with online device Then I confirm that job has 1 job execution And I confirm that job target in job has step index 0 and status "PROCESS_FAILED" - Scenario: Start a Job - JobTarget ok then ok + Scenario: Start - JobTarget ok then ok Given I login as user with name "kapua-sys" and password "kapua-password" And I start the Kura Mock @@ -111,7 +110,7 @@ Feature: JobEngineService stop job tests with online device Then I confirm that job has 2 job execution And I confirm that job target in job has step index 0 and status "PROCESS_OK" - Scenario: Start a Job - JobTarget failed then ok + Scenario: Start - JobTarget failed then ok Given I login as user with name "kapua-sys" and password "kapua-password" And I create a device with name "rpione3" @@ -136,7 +135,7 @@ Feature: JobEngineService stop job tests with online device Then I confirm that job has 2 job execution And I confirm that job target in job has step index 0 and status "PROCESS_OK" - Scenario: Start a Job - Two JobSteps + Scenario: Start - Two JobSteps Given I login as user with name "kapua-sys" and password "kapua-password" And I start the Kura Mock @@ -162,7 +161,7 @@ Feature: JobEngineService stop job tests with online device Then I confirm that job has 1 job execution And I confirm that job target in job has step index 1 and status "PROCESS_OK" - Scenario: Check a Job - Running status + Scenario: Is Running - Check running status Given I login as user with name "kapua-sys" and password "kapua-password" And I start the Kura Mock @@ -186,7 +185,7 @@ Feature: JobEngineService stop job tests with online device Then I confirm that job has 1 job execution And I confirm that job target in job has step index 0 and status "PROCESS_OK" - Scenario: Stop a Job - Not running, never run + Scenario: Stop - Not running, never run Given I login as user with name "kapua-sys" and password "kapua-password" And I create a device with name "Test Target" And I create a job with the name "TestJob" @@ -202,7 +201,7 @@ Feature: JobEngineService stop job tests with online device And I stop the job And An exception was thrown - Scenario: Stop a Job - Not running, but was + Scenario: Stop - Not running, but was Given I login as user with name "kapua-sys" and password "kapua-password" And I start the Kura Mock @@ -223,7 +222,7 @@ Feature: JobEngineService stop job tests with online device And I stop the job And An exception was thrown - Scenario: Stop a Job - Running + Scenario: Stop - Running Given I login as user with name "kapua-sys" and password "kapua-password" And I start the Kura Mock And Device birth message is sent diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature new file mode 100644 index 00000000000..0cc4d37aa12 --- /dev/null +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature @@ -0,0 +1,108 @@ +############################################################################### +# Copyright (c) 2024, 2024 Eurotech and/or its affiliates and others +# +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Eurotech - initial API and implementation +############################################################################### +@env_docker +@it +@jobEngine +@jobEngineTargetProcessors + +Feature: Job Engine Service - Keystore Step Processors + Tests for Device Management Keystore Processor + + @setup + Scenario: Setup test resources + Given Init Security Context + And Start Docker environment with resources + | db | + | events-broker | + | job-engine | + | message-broker | + | broker-auth-service | + | consumer-lifecycle | + + Scenario: Keystore Certificate Create + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I start the Kura Mock + And Device birth message is sent + And Device "rpione3" is connected within 10s + And I create a job with the name "TestJob" + And I add device targets to job + | rpione3 | + And I search for step definition with the name + | Keystore Certificate Create | + And I add job step to job with name "Test Step - Keystore Certificate Create" and with selected job step definition and properties + | name | type | value | + | keystoreId | java.lang.String | SSLKeystore | + | alias | java.lang.String | qaCertificate | + | certificate | java.lang.String | -----BEGIN CERTIFICATE-----\nMIIFVzCCBD+gAwIBAgISA38CzQctm3+HkSyZPnDL8TFsMA0GCSqGSIb3DQEBCwUA\nMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD\nExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTA3MTkxMDIxMTdaFw0x\nOTEwMTcxMDIxMTdaMBsxGTAXBgNVBAMTEG1xdHQuZWNsaXBzZS5vcmcwggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQnt6ZBEZ/vDG0JLqVB45lO6xlLazt\nYpEqZlGBket6PtjUGLdE2XivTpjtUkERS1cvPBqT1DH/yEZ1CU7iT/gfZtZotR0c\nqEMogSGkmrN1sAV6Eb+xGT3sPm1WFeKZqKdzAScdULoweUgwbNXa9kAB1uaSYBTe\ncq2ynfxBKWL/7bVtoeXUOyyaiIxVPTYz5XgpjSUB+9ML/v/+084XhI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WE4MMKBb\ndyu7dj3cYRAFCM9A3y0H967IcY+h0u9FgZibmNs+y/959wcbr8F1kvgpVKDb1FGs\ncuEArADQd3X+4TMM+IeIlqbGVXv3mYPrsP78LmUXkS7ufhMXsD5GSbSc2Zp4/v0o\n3bsJz6qwzixhqg30tf6siOs9yrpHpPnDnbRrahbwnYTpm6JP0lK53GeFec4ckNi3\nzT5+hEVOZ4JYPb3xVXkzIjSWmnDVbwC9MFtRaER9MhugKmiAp8SRLbylD0GKOhSB\n2BDf6JrzhIddKxQ75KgMZE6FQaC3Bz1DFyrj\n-----END CERTIFICATE----- | + | timeout | java.lang.Long | 5000 | + When I start a job + And I wait job to finish its execution up to 10s + Then I confirm that job has 1 job execution + And I confirm that job target in job has step index 0 and status "PROCESS_OK" + # TODO: check that Item has been installed when KuraMock gets refactored + + Scenario: Keystore Keypair Create Processor + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I start the Kura Mock + And Device birth message is sent + And Device "rpione3" is connected within 10s + And I create a job with the name "TestJob" + And I add device targets to job + | rpione3 | + And I search for step definition with the name + | Keystore Keypair Create | + And I add job step to job with name "Test Step - Keystore Keypair Create" and with selected job step definition and properties + | name | type | value | + | keystoreId | java.lang.String | SSLKeystore | + | alias | java.lang.String | qaKeypair | + | size | java.lang.Integer | 4096 | + | algorithm | java.lang.String | RSA | + | signatureAlgorithm | java.lang.String | SHA256withRSA | + | attributes | java.lang.String | CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US | + | timeout | java.lang.Long | 10000 | + When I start a job + And I wait job to finish its execution up to 10s + Then I confirm that job has 1 job execution + And I confirm that job target in job has step index 0 and status "PROCESS_OK" + # TODO: check that Item has been installed when KuraMock gets refactored + + Scenario: Keystore Item Delete Processor + + Given I login as user with name "kapua-sys" and password "kapua-password" + And I start the Kura Mock + And Device birth message is sent + And Device "rpione3" is connected within 10s + And I create a job with the name "TestJob" + And I add device targets to job + | rpione3 | + And I search for step definition with the name + | Keystore Item Delete | + And I add job step to job with name "Test Step - Keystore Item Delete" and with selected job step definition and properties + | name | type | value | + | keystoreId | java.lang.String | SSLKeystore | + | alias | java.lang.String | qaCertificate | + | timeout | java.lang.Long | 10000 | + When I start a job + And I wait job to finish its execution up to 10s + Then I confirm that job has 1 job execution + And I confirm that job target in job has step index 0 and status "PROCESS_OK" + # TODO: check that Item has been installed when KuraMock gets refactored + + @teardown + Scenario: Tear down test resources + Given I logout + And KuraMock is disconnected + And Stop Docker environment + And Clean Locator Instance \ No newline at end of file diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOfflineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOfflineDeviceI9n.feature index 91343912621..86abf46646d 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOfflineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOfflineDeviceI9n.feature @@ -12,7 +12,6 @@ ############################################################################### @env_docker @it -@jobEngine @jobEngineRestartOfflineDevice Feature: JobEngineService tests for restarting job with offline device diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature index 4c238143fb0..b7143da3e38 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceI9n.feature @@ -12,7 +12,6 @@ ############################################################################### @env_docker @it -@jobEngine @jobEngineRestartOnlineDevice Feature: JobEngineService restart job tests with online device diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature index bd517a6c55a..091abf4b764 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceRestartOnlineDeviceSecondPartI9n.feature @@ -12,7 +12,6 @@ ############################################################################### @env_docker @it -@jobEngine @jobEngineRestartOnlineDeviceSecondPart Feature: JobEngineService restart job tests with online device - second part diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature index 228678f872d..f034ae8f659 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOfflineDeviceI9n.feature @@ -12,7 +12,6 @@ ############################################################################### @env_docker @it -@jobEngine @jobEngineStartOfflineDevice Feature: JobEngineService tests for starting job with offline device diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOnlineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOnlineDeviceI9n.feature index fc70d79fc55..6dec95a2886 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOnlineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStartOnlineDeviceI9n.feature @@ -12,7 +12,6 @@ ############################################################################### @env_docker @it -@jobEngine @jobEngineStartOnlineDevice Feature: JobEngineService start job tests with online device diff --git a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStopOnlineDeviceI9n.feature b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStopOnlineDeviceI9n.feature index a142ee947dc..bd4438cacf9 100644 --- a/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStopOnlineDeviceI9n.feature +++ b/qa/integration/src/test/resources/features/jobEngine/JobEngineServiceStopOnlineDeviceI9n.feature @@ -12,7 +12,6 @@ ############################################################################### @env_docker @it -@jobEngine @jobEngineServiceStop Feature: JobEngineService stop job tests with online device