Skip to content

Commit

Permalink
♻️ [Test] Added new set of test cases to test JobEngine Device Manage…
Browse files Browse the repository at this point in the history
…ment Command Target Processors

Signed-off-by: Alberto Codutti <[email protected]>
  • Loading branch information
Coduz committed Jan 20, 2025
1 parent 23e55f5 commit 1f8e60b
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
// "classpath:features/jobEngine/JobEngineServiceOperations.feature",
// "classpath:features/jobEngine/JobEngineServiceProcessorKeystoreI9n.feature",
// "classpath:features/jobEngine/JobEngineServiceProcessorAssetI9n.feature",
"classpath:features/jobEngine/JobEngineServiceProcessorBundleI9n.feature",
// "classpath:features/jobEngine/JobEngineServiceProcessorBundleI9n.feature",
"classpath:features/jobEngine/JobEngineServiceProcessorCommandI9n.feature",
},
glue = {
"org.eclipse.kapua.service.job.steps",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
###############################################################################
# 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 - Command Step Processors
Tests for Device Management Command 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: Command Exec - XML

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
| Command Execution |
And I add job step to job with name "Test Step - Command Exec - XML" and with selected job step definition and properties
| name | type | value |
| commandInput | org.eclipse.kapua.service.device.management.command.DeviceCommandInput | <?xml version="1.0" encoding="UTF-8"?><commandInput><command>touch</command><arguments><argument>xml.test</argument></arguments><timeout>2500</timeout><runAsynch>false</runAsynch></commandInput> |
| 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 command has been executed when KuraMock gets refactored

Scenario: Command Exec - JSON

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
| Command Execution |
And I add job step to job with name "Test Step - Command Exec - JSON" and with selected job step definition and properties
| name | type | value |
| commandInput | org.eclipse.kapua.service.device.management.command.DeviceCommandInput | { "command" : "touch", "arguments" : { "argument" : ["json.test" ] }, "timeout" : "5000" } |
| 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 command has been executed 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

0 comments on commit 1f8e60b

Please sign in to comment.