Skip to content

Commit

Permalink
Fix tinkerbell#257 : Added following test cases:
Browse files Browse the repository at this point in the history
1. One workflow with one worker where all the actions are successful
2. One workflow with one worker where an action gets failed
3. One workflow with one worker where an action gets timed out

Signed-off-by: parauliya <[email protected]>
  • Loading branch information
parauliya committed Aug 21, 2020
1 parent 7eb10ca commit 3dc21ff
Show file tree
Hide file tree
Showing 6 changed files with 392 additions and 53 deletions.
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ require (
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.3.0
go.mongodb.org/mongo-driver v1.1.2 // indirect
<<<<<<< HEAD
=======
go.uber.org/atomic v1.2.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.7.1 // indirect
>>>>>>> Fix #257 : Added following test cases:
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d // indirect
Expand Down
30 changes: 30 additions & 0 deletions test/_vagrant/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"id": "ce2e62ed-826f-4485-a39f-a82bb74338e2",
"metadata": {
"facility": {
"facility_code": "onprem"
},
"instance": {},
"state": ""
},
"network": {
"interfaces": [
{
"dhcp": {
"arch": "x86_64",
"ip": {
"address": "192.168.1.5",
"gateway": "192.168.1.1",
"netmask": "255.255.255.248"
},
"mac": "08:00:27:00:00:01",
"uefi": false
},
"netboot": {
"allow_pxe": true,
"allow_workflow": true
}
}
]
}
}
18 changes: 18 additions & 0 deletions test/_vagrant/failedWorkflow.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '0.1'
name: packet_osie_provision
global_timeout: 600
tasks:
- name: "timeout-task"
worker: "{{.device_1}}"
actions:
- name: "hello_world"
image: hello-world
timeout: 10
on-timeout: ["echo", "Timeout"]
on-failure: ["echo", "Failure"]
- name: "sleep-till-timeout"
image: bash
command: ["sleepys", "20"]
timeout: 6
on-timeout: ["echo", "Timeout"]
on-failure: ["echo", "Failure"]
10 changes: 10 additions & 0 deletions test/_vagrant/hello-world.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "0.1"
name: hello_world_workflow
global_timeout: 600
tasks:
- name: "hello world"
worker: "{{.device_1}}"
actions:
- name: "hello_world"
image: hello-world
timeout: 60
18 changes: 18 additions & 0 deletions test/_vagrant/timeout.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '0.1'
name: packet_osie_provision
global_timeout: 600
tasks:
- name: "timeout-task"
worker: "{{.device_1}}"
actions:
- name: "hello_world"
image: hello-world
timeout: 10
on-timeout: ["echo", "Timeout"]
on-failure: ["echo", "Failure"]
- name: "sleep-till-timeout"
image: bash
command: ["sleep", "20"]
timeout: 6
on-timeout: ["echo", "Timeout"]
on-failure: ["echo", "Failure"]
Loading

0 comments on commit 3dc21ff

Please sign in to comment.