Compare commits
2 Commits
feature/do
...
test-molec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edea25ee38 | ||
|
|
db1eddccb8 |
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.7-stretch
|
FROM python:3.7
|
||||||
RUN curl -fsSL https://get.docker.com | sh
|
RUN curl -fsSL https://get.docker.com | sh
|
||||||
RUN pip3 install docker molecule==2.22rc1 molecule[docker] flake8
|
RUN pip3 install docker molecule[docker,ansible] pytest pytest-testinfra flake8
|
||||||
WORKDIR mono/deployment-e2e
|
WORKDIR mono/deployment-e2e
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ dependency:
|
|||||||
name: galaxy
|
name: galaxy
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
enabled: True
|
|
||||||
options:
|
|
||||||
config-data:
|
|
||||||
ignore: ../../hosts.yml
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: monitor-host
|
- name: monitor-host
|
||||||
groups:
|
groups:
|
||||||
@@ -22,11 +16,6 @@ platforms:
|
|||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
enabled: True
|
|
||||||
options:
|
|
||||||
r: ["bug"]
|
|
||||||
playbooks:
|
playbooks:
|
||||||
prepare: ../prepare.yml
|
prepare: ../prepare.yml
|
||||||
converge: ./converge.yml
|
converge: ./converge.yml
|
||||||
@@ -37,14 +26,11 @@ provisioner:
|
|||||||
syslog_server_port: "udp://127.0.0.1:514"
|
syslog_server_port: "udp://127.0.0.1:514"
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
|
||||||
name: flake8
|
|
||||||
additional_files_or_dirs:
|
additional_files_or_dirs:
|
||||||
- ../../tests/*
|
- ../../tests/*
|
||||||
scenario:
|
scenario:
|
||||||
name: monitor
|
name: monitor
|
||||||
test_sequence:
|
test_sequence:
|
||||||
- lint
|
|
||||||
- cleanup
|
- cleanup
|
||||||
- destroy
|
- destroy
|
||||||
- dependency
|
- dependency
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ dependency:
|
|||||||
name: galaxy
|
name: galaxy
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
enabled: True
|
|
||||||
options:
|
|
||||||
config-data:
|
|
||||||
ignore: ../../hosts.yml
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: multiple-host
|
- name: multiple-host
|
||||||
groups:
|
groups:
|
||||||
@@ -23,11 +17,6 @@ platforms:
|
|||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
enabled: True
|
|
||||||
options:
|
|
||||||
r: ["bug"]
|
|
||||||
playbooks:
|
playbooks:
|
||||||
prepare: ../prepare.yml
|
prepare: ../prepare.yml
|
||||||
converge: ../monitor/converge.yml
|
converge: ../monitor/converge.yml
|
||||||
@@ -39,14 +28,11 @@ provisioner:
|
|||||||
syslog_server_port: "udp://127.0.0.1:514"
|
syslog_server_port: "udp://127.0.0.1:514"
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
|
||||||
name: flake8
|
|
||||||
additional_files_or_dirs:
|
additional_files_or_dirs:
|
||||||
- ../../tests/*
|
- ../../tests/*
|
||||||
scenario:
|
scenario:
|
||||||
name: multiple
|
name: multiple
|
||||||
test_sequence:
|
test_sequence:
|
||||||
- lint
|
|
||||||
- cleanup
|
- cleanup
|
||||||
- destroy
|
- destroy
|
||||||
- dependency
|
- dependency
|
||||||
|
|||||||
@@ -3,18 +3,12 @@ dependency:
|
|||||||
name: galaxy
|
name: galaxy
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
lint:
|
|
||||||
name: yamllint
|
|
||||||
enabled: True
|
|
||||||
options:
|
|
||||||
config-data:
|
|
||||||
ignore: ../../hosts.yml
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: oracle-host
|
- name: oracle-host
|
||||||
groups:
|
groups:
|
||||||
- example
|
- example
|
||||||
children:
|
children:
|
||||||
- oracle
|
- oracle_swarm
|
||||||
image: ubuntu:16.04
|
image: ubuntu:16.04
|
||||||
privileged: true
|
privileged: true
|
||||||
network_mode: host
|
network_mode: host
|
||||||
@@ -22,29 +16,22 @@ platforms:
|
|||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
lint:
|
|
||||||
name: ansible-lint
|
|
||||||
enabled: True
|
|
||||||
options:
|
|
||||||
r: ["bug"]
|
|
||||||
playbooks:
|
playbooks:
|
||||||
prepare: ../prepare.yml
|
prepare: ../prepare.yml
|
||||||
converge: ../../../deployment/site.yml
|
converge: ../../../deployment/site.yml
|
||||||
inventory:
|
inventory:
|
||||||
host_vars:
|
host_vars:
|
||||||
oracle-host:
|
oracle-host:
|
||||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "6c48435bd464a53ed66ed62127c4dba8af75cf1a99a8ebe2680599948fbfbc6d"
|
ORACLE_VALIDATOR_KEYSTORE_PATH: "../../../e2e-commons/keystore.json"
|
||||||
|
ORACLE_VALIDATOR_KEYSTORE_PASSWORD: "12345678"
|
||||||
syslog_server_port: "udp://127.0.0.1:514"
|
syslog_server_port: "udp://127.0.0.1:514"
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
|
||||||
name: flake8
|
|
||||||
additional_files_or_dirs:
|
additional_files_or_dirs:
|
||||||
- ../../tests/*
|
- ../../tests/*
|
||||||
scenario:
|
scenario:
|
||||||
name: oracle
|
name: oracle
|
||||||
test_sequence:
|
test_sequence:
|
||||||
- lint
|
|
||||||
- cleanup
|
- cleanup
|
||||||
- destroy
|
- destroy
|
||||||
- dependency
|
- dependency
|
||||||
|
|||||||
@@ -3,22 +3,21 @@ import pytest
|
|||||||
import testinfra.utils.ansible_runner
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('oracle')
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('oracle_swarm')
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("name", [
|
@pytest.mark.parametrize("name", [
|
||||||
("oracle_rabbit_1"),
|
("oracle_rabbit"),
|
||||||
("oracle_redis_1"),
|
("oracle_redis"),
|
||||||
("oracle_bridge_request_1"),
|
("oracle_bridge_request"),
|
||||||
("oracle_bridge_collected_1"),
|
("oracle_bridge_collected"),
|
||||||
("oracle_bridge_affirmation_1"),
|
("oracle_bridge_affirmation"),
|
||||||
("oracle_bridge_senderhome_1"),
|
("oracle_bridge_senderhome"),
|
||||||
("oracle_bridge_senderforeign_1"),
|
("oracle_bridge_senderforeign"),
|
||||||
("oracle_bridge_shutdown_1"),
|
("oracle_bridge_shutdown"),
|
||||||
])
|
])
|
||||||
def test_docker_containers(host, name):
|
def test_docker_containers(host, name):
|
||||||
container = host.docker(name)
|
assert host.docker(name) is not None
|
||||||
assert container.is_running
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("service", [
|
@pytest.mark.parametrize("service", [
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ platforms:
|
|||||||
- ultimate
|
- ultimate
|
||||||
- amb
|
- amb
|
||||||
children:
|
children:
|
||||||
- oracle
|
- oracle_swarm
|
||||||
image: ubuntu:16.04
|
image: ubuntu:16.04
|
||||||
privileged: true
|
privileged: true
|
||||||
network_mode: host
|
network_mode: host
|
||||||
@@ -21,12 +21,10 @@ provisioner:
|
|||||||
inventory:
|
inventory:
|
||||||
host_vars:
|
host_vars:
|
||||||
oracle-amb-host:
|
oracle-amb-host:
|
||||||
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
ORACLE_VALIDATOR_KEYSTORE_PATH: "../../../e2e-commons/keystore_ultimate.json"
|
||||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
ORACLE_VALIDATOR_KEYSTORE_PASSWORD: "12345678"
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
|
||||||
name: flake8
|
|
||||||
scenario:
|
scenario:
|
||||||
name: ultimate-amb
|
name: ultimate-amb
|
||||||
test_sequence:
|
test_sequence:
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ provisioner:
|
|||||||
ORACLE_FOREIGN_START_BLOCK: 1
|
ORACLE_FOREIGN_START_BLOCK: 1
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
|
||||||
name: flake8
|
|
||||||
scenario:
|
scenario:
|
||||||
name: ultimate-erc-to-native
|
name: ultimate-erc-to-native
|
||||||
test_sequence:
|
test_sequence:
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
# pre-release because it contains "CI Fixes for ansible 2.8"
|
|
||||||
molecule==2.22rc1
|
|
||||||
docker
|
|
||||||
flake8
|
|
||||||
@@ -46,6 +46,9 @@
|
|||||||
group: docker
|
group: docker
|
||||||
createhome: yes
|
createhome: yes
|
||||||
|
|
||||||
|
- name: reset ssh connection to allow user changes to affect ansible user
|
||||||
|
meta: reset_connection
|
||||||
|
|
||||||
- name: Install auditd
|
- name: Install auditd
|
||||||
apt:
|
apt:
|
||||||
name: auditd
|
name: auditd
|
||||||
|
|||||||
@@ -4,3 +4,5 @@
|
|||||||
name: "{{ oracle_image }}"
|
name: "{{ oracle_image }}"
|
||||||
source: pull
|
source: pull
|
||||||
when: skip_pull is undefined
|
when: skip_pull is undefined
|
||||||
|
vars:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
name: oracle_keystore
|
name: oracle_keystore
|
||||||
state: present
|
state: present
|
||||||
data_src: "{{ keystore_path }}"
|
data_src: "{{ keystore_path }}"
|
||||||
|
vars:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|
||||||
- name: Remove unencrypted keystore file
|
- name: Remove unencrypted keystore file
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -4,11 +4,15 @@
|
|||||||
state: present
|
state: present
|
||||||
autolock_managers: yes
|
autolock_managers: yes
|
||||||
listen_addr: 127.0.0.1:2377
|
listen_addr: 127.0.0.1:2377
|
||||||
|
vars:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|
||||||
- name: Get unlock token
|
- name: Get unlock token
|
||||||
community.docker.docker_swarm_info:
|
community.docker.docker_swarm_info:
|
||||||
unlock_key: yes
|
unlock_key: yes
|
||||||
register: result
|
register: result
|
||||||
|
vars:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|
||||||
- name: Print unlock token
|
- name: Print unlock token
|
||||||
debug:
|
debug:
|
||||||
|
|||||||
86
deployment/roles/oracle_swarm/templates/.env.j2
Normal file
86
deployment/roles/oracle_swarm/templates/.env.j2
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
## General settings
|
||||||
|
ORACLE_BRIDGE_MODE={{ ORACLE_BRIDGE_MODE }}
|
||||||
|
{% if ORACLE_LOG_LEVEL | default('') != '' %}
|
||||||
|
ORACLE_LOG_LEVEL={{ ORACLE_LOG_LEVEL }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
## Home contract
|
||||||
|
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }}
|
||||||
|
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }}
|
||||||
|
ORACLE_HOME_RPC_POLLING_INTERVAL={{ ORACLE_HOME_RPC_POLLING_INTERVAL }}
|
||||||
|
|
||||||
|
## Foreign contract
|
||||||
|
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }}
|
||||||
|
{% if ORACLE_FOREIGN_ARCHIVE_RPC_URL | default('') != '' %}
|
||||||
|
ORACLE_FOREIGN_ARCHIVE_RPC_URL={{ ORACLE_FOREIGN_ARCHIVE_RPC_URL }}
|
||||||
|
{% endif %}
|
||||||
|
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }}
|
||||||
|
ORACLE_FOREIGN_RPC_POLLING_INTERVAL={{ ORACLE_FOREIGN_RPC_POLLING_INTERVAL }}
|
||||||
|
|
||||||
|
{% if ORACLE_TX_REDUNDANCY | default('') != '' %}
|
||||||
|
ORACLE_TX_REDUNDANCY={{ ORACLE_TX_REDUNDANCY }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
## Gasprice
|
||||||
|
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %}
|
||||||
|
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if COMMON_HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||||
|
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }}
|
||||||
|
{% endif %}
|
||||||
|
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }}
|
||||||
|
{% if ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
|
||||||
|
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL={{ ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %}
|
||||||
|
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | default('') != '' %}
|
||||||
|
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||||
|
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }}
|
||||||
|
{% endif %}
|
||||||
|
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }}
|
||||||
|
{% if ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
|
||||||
|
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if COMMON_FOREIGN_GAS_PRICE_FACTOR | default('') != '' %}
|
||||||
|
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
## Transport configuration
|
||||||
|
ORACLE_ALLOW_HTTP_FOR_RPC={{ "yes" if ORACLE_ALLOW_HTTP_FOR_RPC else "no" }}
|
||||||
|
ORACLE_QUEUE_URL={{ ORACLE_QUEUE_URL }}
|
||||||
|
ORACLE_REDIS_URL={{ ORACLE_REDIS_URL }}
|
||||||
|
{% if ORACLE_FOREIGN_TX_RESEND_INTERVAL | default('') != '' %}
|
||||||
|
ORACLE_FOREIGN_TX_RESEND_INTERVAL={{ ORACLE_FOREIGN_TX_RESEND_INTERVAL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ORACLE_HOME_TX_RESEND_INTERVAL | default('') != '' %}
|
||||||
|
ORACLE_HOME_TX_RESEND_INTERVAL={{ ORACLE_HOME_TX_RESEND_INTERVAL }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
## Emergency shutdown configuration
|
||||||
|
{% if ORACLE_SHUTDOWN_SERVICE_URL | default('') != '' %}
|
||||||
|
ORACLE_SHUTDOWN_SERVICE_URL={{ ORACLE_SHUTDOWN_SERVICE_URL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ORACLE_SHUTDOWN_SERVICE_POLLING_INTERVAL | default('') != '' %}
|
||||||
|
ORACLE_SHUTDOWN_SERVICE_POLLING_INTERVAL={{ ORACLE_SHUTDOWN_SERVICE_POLLING_INTERVAL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ORACLE_SIDE_RPC_URL | default('') != '' %}
|
||||||
|
ORACLE_SIDE_RPC_URL={{ ORACLE_SIDE_RPC_URL }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ORACLE_SHUTDOWN_CONTRACT_ADDRESS | default('') != '' %}
|
||||||
|
ORACLE_SHUTDOWN_CONTRACT_ADDRESS={{ ORACLE_SHUTDOWN_CONTRACT_ADDRESS }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ORACLE_SHUTDOWN_CONTRACT_METHOD | default('') != '' %}
|
||||||
|
ORACLE_SHUTDOWN_CONTRACT_METHOD={{ ORACLE_SHUTDOWN_CONTRACT_METHOD }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if ORACLE_HOME_START_BLOCK | default('') != '' %}
|
||||||
|
ORACLE_HOME_START_BLOCK={{ ORACLE_HOME_START_BLOCK }}
|
||||||
|
{% endif %}
|
||||||
|
{% if ORACLE_FOREIGN_START_BLOCK | default('') != '' %}
|
||||||
|
ORACLE_FOREIGN_START_BLOCK={{ ORACLE_FOREIGN_START_BLOCK }}
|
||||||
|
{% endif %}
|
||||||
1
e2e-commons/keystore.json
Normal file
1
e2e-commons/keystore.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"version":3,"id":"e7e64a1b-5e61-4c17-a473-963d2bbb59e5","address":"d138a69eb2da1c3518e792737c820b23cce62e4b","crypto":{"ciphertext":"f6ddf0b2638fb9fd5777de2aa07937b5ee9bc17acc74c8e6e6580e2dfd0d3de6","cipherparams":{"iv":"bcdbc5af4582887e5cdcf264e8d5b80d"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"f9e621918990e64e278e0fb8cf0343219e1cceaea8547d50fae452ad8f42f231","n":8192,"r":8,"p":1},"mac":"34149cd0b3ddea52588825d403fb75cfb8b864b616d455f75f2de001cc2601ed"}}]
|
||||||
Reference in New Issue
Block a user