Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
GITHUB_TOKEN
*.pyc
*.retry
inventory
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: required
services:
- docker
language: python
python:
- "2.7"
before_install:
- docker build -t lepidopter/integration --build-arg lepidopter_update_tag=$TRAVIS_COMMIT tests/integration
script:
- make unittest
- docker run lepidopter/integration
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
all:
echo "nothing"

unittest:
python updater/test_*.py

create-testvm:
ansible-playbook -i deploy/inventory deploy/create-vm.yml

delete-testvm:
ansible-playbook -i deploy/inventory deploy/delete-vm.yml

reset-testvm: delete-testvm create-testvm
44 changes: 44 additions & 0 deletions deploy/create-vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
- name: ensure that a single instance is launched
hosts: localhost
gather_facts: no
vars:
instance_name: 'lepidopter-update-test'
instance_region: 'ams1'
api_baseurl: "https://portal.eclips.is/portal/api/v2"
ssh_key_id: 77
tasks:
- name: ensure instance is created
eclipsis_droplet:
state: present
api_baseurl: "{{ api_baseurl }}"
name: "{{ instance_name }}"
region: "{{ instance_region }}"
size: 512
disk: 10
ssh_key_id: "{{ ssh_key_id }}"
# This stands for jessie-x64
image_id: 6
unique_name: "yes"
register: instance_info

- debug:
msg: "Instance info {{ instance_info }}"

- name: add instance to in-memory hosts
add_host:
hostname: "{{ instance_info.droplet.networks.v4[0].ip_address }}"
groupname: eclipsis_hosts

- name: wait for it to listen on port 22
wait_for:
state: started
host: "{{ instance_info.droplet.networks.v4[0].ip_address }}"
port: 22

- name: ensure that the base updater is setup on the machine
hosts: eclipsis_hosts
remote_user: root
gather_facts: no
roles:
- common
- lepidopter_v0.2.1
15 changes: 15 additions & 0 deletions deploy/delete-vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: ensure that the instance does not exist
hosts: localhost
gather_facts: no
vars:
instance_name: 'lepidopter-update-test'
instance_region: 'ams1'
ssh_key_id: 77
tasks:
- name: ensure instance doesn't exist
eclipsis_droplet:
state: absent
name: "{{ instance_name }}"
unique_name: "yes"
wait_timeout: 10
register: instance_info
Loading