Skip to content

Commit

Permalink
Fixed Issue 80: Modified the test framework for tink repo
Browse files Browse the repository at this point in the history
This framework was written a while ago but is commented and there have been a lot of changes since then.
1. Remove the target concepts completely
2. Changed the way of writting templates
3. Changed the way of creating workflows
4. Generating certs are not the part of docker-compose anymore

TODO:
This framework works well for single worker. There are few changes required in the framework to make it work for multiple workers
  • Loading branch information
parauliya committed Jun 29, 2020
1 parent adf2ebb commit b453857
Show file tree
Hide file tree
Showing 16 changed files with 332 additions and 556 deletions.
9 changes: 8 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ quay_settings_pr: &quay_settings_pr
password:
from_secret: public_docker_password


kind: pipeline
type: docker
name: default
Expand All @@ -54,7 +55,13 @@ steps:
- name: test
image: golang:1.13-alpine3.11
commands:
- CGO_ENABLED=0 go test -v ./...
- apk add --update make
- apk add docker
- apk add docker-compose
- CGO_ENABLED=0 make test
volumes:
- name: docker_sock
path: /var/run/docker.sock

- name: ci-checks
image: nixos/nix:2.3.4
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ require (
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec // indirect
github.com/spf13/pflag v1.0.1 // indirect
github.com/spf13/viper v1.0.2
github.com/stretchr/testify v1.3.0
go.mongodb.org/mongo-driver v1.1.2 // indirect
go.uber.org/atomic v1.2.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
Expand Down
158 changes: 0 additions & 158 deletions test-docker-compose.yml

This file was deleted.

5 changes: 1 addition & 4 deletions test/actions/update_data/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
FROM bash
ADD hello_world.sh /bin/hello_world.sh
RUN chmod +x /bin/hello_world.sh
#CMD echo '{"action_01": "data_01"}' > /workflow/data
ENTRYPOINT [ "/bin/hello_world.sh" ]
CMD echo '{"action_01": "data_01"}' > /workflow/data
128 changes: 23 additions & 105 deletions test/data/hardware/hardware_1.json
Original file line number Diff line number Diff line change
@@ -1,112 +1,30 @@
{
"allow_pxe": true,
"arch": "x86_64",
"bonding_mode": 4,
"efi_boot": true,
"facility_code": "ewr1",
"id": "f9f56dff-098a-4c5f-a51c-19ad35de85d1",
"instance": {
"allow_pxe": true,
"always_pxe": true,
"customdata": {},
"hostname": "sample-machine",
"id": "3b2cccf1-1906-4d82-9fe0-c6d5188e70eb",
"ip_addresses": [],
"ipxe_script_url": "https://boot.netboot.xyz",
"network_ready": false,
"operating_system_version": {
"distro": "custom_ipxe",
"image_tag": null,
"os_slug": "custom_ipxe",
"slug": "custom_ipxe",
"version": "1"
"metadata": {
"facility": {
"facility_code": "onprem"
},
"project": {},
"rescue": false,
"ssh_keys": [],
"state": "active",
"storage": {},
"tags": [],
"userdata": ""
"instance": {},
"state": ""
},
"ip_addresses": [
{
"address": "172.24.7.50",
"address_family": 4,
"cidr": 30,
"enabled": true,
"gateway": "172.24.7.49",
"management": true,
"netmask": "255.255.255.252",
"network": "172.24.7.48",
"public": false,
"type": "data"
},
{
"address": "10.250.42.38",
"gateway": "10.250.42.1",
"netmask": "255.255.255.0",
"type": "ipmi"
}
],
"management": {
"address": "10.250.42.38",
"gateway": "10.250.42.1",
"netmask": "255.255.255.0",
"type": "ipmi"
},
"manufacturer": {
"id": "5c6dc6d1-0b75-4e77-811e-e2d3b4e5312a",
"slug": "dell"
},
"network_ports": [
{
"connected_ports": [
{
"data": {
"bond": null,
"mac": null
"network": {
"interfaces": [
{
"dhcp": {
"arch": "x86_64",
"ip": {
"address": "192.168.1.5",
"gateway": "192.168.1.1",
"netmask": "255.255.255.248"
},
"hostname": "",
"id": "421f34e5-b141-4c4a-8234-239996bf7a1a",
"name": "xe-0/0/28",
"type": "data"
"mac": "98:03:9b:89:d7:ba",
"uefi": false
},
"netboot": {
"allow_pxe": true,
"allow_workflow": true
}
],
"data": {
"bond": null,
"mac": "98:03:9b:89:d7:ba"
},
"id": "213394d4-8642-443d-9140-c625cfaeb354",
"name": "eth0",
"type": "data"
},
{
"connected_ports": [],
"data": {
"bond": null,
"mac": "98:03:9b:89:d7:bb"
},
"id": "da245720-aa41-4368-9eca-7fb5af8bd492",
"name": "eth1",
"type": "data"
},
{
"connected_ports": [],
"data": {
"bond": null,
"mac": "4c:d9:8f:42:21:f3"
},
"id": "b1b7c29c-41d0-479d-9dbc-392250b8b36f",
"name": "ipmi0",
"type": "ipmi"
}
],
"plan_slug": "c2.medium.x86",
"plan_version_slug": "c2.medium.x86.01",
"preinstalled_operating_system_version": {},
"services": {},
"state": "in_use",
"type": "server",
"vlan_id": null
}
]
}
}
Loading

0 comments on commit b453857

Please sign in to comment.