Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
various improvements across the board
- Loading branch information
Gigi
committed
May 11, 2014
1 parent
a13be67
commit 004e500
Showing
20 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from unittest import TestCase | ||
|
||
|
||
class LoadTest(TestCase): | ||
def setUp(self): | ||
""" | ||
""" | ||
|
||
def test_load(self): | ||
""" | ||
""" | ||
# Launch the system | ||
|
||
# Generate artificial load | ||
|
||
# Wait for system to process load | ||
|
||
# Verify load was handled properly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from unittest import TestCase | ||
|
||
|
||
class LoadTest(TestCase): | ||
def setUp(self): | ||
""" | ||
""" | ||
|
||
def test_load(self): | ||
""" | ||
""" | ||
|
||
# Mock dependencies as necessary | ||
|
||
# Launch the system | ||
|
||
# Generate diverse input | ||
|
||
# Verify input was processed properly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Generate alien abduction and probe requests""" | ||
from datetime import datetime, timedelta | ||
|
||
|
||
class Simulator(object): | ||
def __init__(self, duration, delay, acme_url): | ||
assert isinstance(duration, timedelta) | ||
assert isinstance(delay, timedelta) | ||
|
||
self.duration = duration | ||
self.delay = delay | ||
self.acme_url = acme_url | ||
|
||
def run(self): | ||
start = datetime.now() | ||
end = start + self.duration | ||
|
||
while datetime.now() < end: | ||
request = self._generate_request() | ||
self._send_request() | ||
|
||
def _send_request(self): | ||
raise NotImplementedError | ||
|
||
def _generate_request(self): | ||
raise NotImplementedError |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
[service] | ||
192.168.44.11 | ||
192.168.44.12 | ||
|
||
[api] | ||
192.168.44.12 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- hosts: service | ||
roles: | ||
- base_server | ||
- provision_service | ||
- deploy_service | ||
|
||
vars: | ||
user: acme | ||
app_name: acme_api | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
- hosts: db | ||
sudo: yes | ||
roles: | ||
- base_server | ||
- mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
- hosts: service | ||
roles: | ||
- base_server | ||
- provision_service | ||
- deploy_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Install base sytem packages that every server needs | ||
apt: name={{ item }} state=installed update_cache=true | ||
with_items: base_apt_packages | ||
|
||
# http://stackoverflow.com/questions/5585875/what-is-the-official-preferred-way-to-install-pip-and-virtualenv-systemwide | ||
- name: Install pip and virtualenv | ||
shell: > | ||
curl --silent --show-error --retry 5 | ||
https://raw.github.com/pypa/pip/master/contrib/get-pip.py | | ||
sudo python2.7 | ||
- name: pip install base Python packages | ||
pip: name={{ item }} state=present | ||
with_items: base_pip_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
base_apt_packages: | ||
- build-essential | ||
- git | ||
- python-software-properties | ||
- python-dev | ||
|
||
base_pip_packages: | ||
- virtualenvwrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: symlink nginx.conf | ||
file: path=/var/www state=directory owner={{ user }} | ||
|
||
- name: Install web app conf file | ||
template: > | ||
src={{ app_name }}.conf.j2 | ||
dest=/etc/nginx/sites-available/{{ app_name }}.conf | ||
- name: Enable csvserver via symlink | ||
file: > | ||
src=/etc/nginx/sites-available/csv_server.conf | ||
dest=/etc/nginx/sites-enabled/csv_server.conf | ||
owner={{ user }} group={{ user }} state=link | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- name: Install nginx | ||
action: apt pkg=nginx-extras state=latest install_recommends=yes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |