diff --git a/.githooks/post-commit b/.githooks/post-commit
index fffb01be78319dd66c2bf1f1c1c956d94c4ec232..764243ecb5b496fe1946c2d181c5920413e8a46c 100644
--- a/.githooks/post-commit
+++ b/.githooks/post-commit
@@ -1,4 +1,6 @@
 #!/bin/bash
-mkdir .build-config
-git rev-list --count integration > .build-config/git-commit-count
-git describe --all --long > .build-config/git-commit-version
\ No newline at end of file
+
+CI_COMMIT_REF_NAME=`git rev-parse --abbrev-ref HEAD`
+CI_COMMIT_SHA=`git rev-parse HEAD`
+
+echo $CI_COMMIT_REF_NAME"-"$CI_COMMIT_SHA > clmctest/git-commit-ref
diff --git a/.gitignore b/.gitignore
index 3606f48ab501a0bb12774f0c27851fc23e18d82e..03f004a3b864ac817f2befe33248e8a69d763227 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@
 *__pycache__*
 *__init__.pyc
 *egg-info*
-ubuntu-xenial-16.04-cloudimg-console.log
\ No newline at end of file
+*git-commit-ref*
+ubuntu-xenial-16.04-cloudimg-console.log
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b86c40851ab293ed5830ed70f34a513fc0fcc476..ce2b84324651d7c8b83d8967bedec87633ef529d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,42 +1,33 @@
 stages:  
-  - test:scripts
-  - test:monitoring
-  - test:inputs
-  
-test:scripts:
-  stage: test:scripts
-  before_script:
-    - vagrant --fixture=scripts -- destroy --force 
+  - build
+  - test
+  - clean
+
+build:tests:
+  stage: build
   script: 
-    - vagrant --fixture=scripts -- up
-    - vagrant --fixture=scripts -- ssh test-runner -- -tt "cd /vagrant && pytest clmctest/scripts/"
-  after_script:
-    - vagrant --fixture=scripts -- destroy --force
-  when: manual
-  
-test:monitoring:
-  stage: test:streaming_sim
-  before_script:
-    - vagrant --fixture=monitoring -- destroy --force    
+    - python setup.py sdist --dist-dir=build
+  artifacts:
+    paths:
+    - build/clmctest-SNAPSHOT.tar.gz
+    expire_in: 1 day
+
+test:all:
+  stage: test
+  dependencies: 
+    - build:tests
   script: 
+    - vagrant --fixture=scripts -- up
+    - vagrant --fixture=scripts -- ssh test-runner -- -tt "pip3 install /vagrant/build/clmctest-SNAPSHOT.tar.gz"
+    - vagrant --fixture=scripts -- ssh test-runner -- -tt "pytest -s --pyargs clmctest.scripts"
     - vagrant --fixture=monitoring -- up
-    - vagrant --fixture=monitoring -- ssh test-runner -- -tt "cd /vagrant && pytest clmctest/monitoring/"
-  after_script:
-    - vagrant --fixture=monitoring -- destroy --force   
-  when: manual  
-  
-test:inputs:
-  stage: test:inputs
-  before_script:
-    - vagrant --fixture=inputs -- destroy --force      
-  script: 
+    - vagrant --fixture=monitoring -- ssh test-runner -- -tt "pytest -s --pyargs clmctest.monitoring"  
     - vagrant --fixture=inputs -- up
-    - vagrant --fixture=inputs -- ssh test-runner -- -tt "cd /vagrant && pytest clmctest/inputs/"
-  after_script:
-    - vagrant --fixture=inputs -- destroy --force       
-  when: manual    
-
-  
-
+    - vagrant --fixture=inputs -- ssh test-runner -- -tt "pytest -s --pyargs clmctest.inputs"        
+  when: on_success      
   
-
+clean:
+  stage: clean
+  script: 
+    - scripts/build/deleteallvms.sh   
+  when: always       
\ No newline at end of file
diff --git a/MANIFEST.in b/MANIFEST.in
index 993dbd0acf646a37d2568ce5ab0b8dad4df6ba40..e35073b81267d4310b40f6d473d9335ace576866 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1,2 @@
 include MANIFEST.in
-recursive-include clmctest *.yml *.sh
\ No newline at end of file
+recursive-include clmctest *.yml *.sh *.json *.conf
\ No newline at end of file
diff --git a/clmctest/inputs/conftest.py b/clmctest/inputs/conftest.py
index 0a1be8ff018d05e38bc15cd0edf3543ea322c825..aab39c31dc321060faa907d7c8adc3fe9261c704 100644
--- a/clmctest/inputs/conftest.py
+++ b/clmctest/inputs/conftest.py
@@ -1,6 +1,7 @@
 #!/usr/bin/python3
 
 import pytest
+import time
 import yaml
 import pkg_resources
 from influxdb import InfluxDBClient
@@ -24,11 +25,17 @@ def telegraf_agent_config(request):
 @pytest.fixture(params=[{'database': 'CLMCMetrics'}], scope='module')
 def influxdb(telegraf_agent_config, request):
     """
-    Creates an Influx DB client for the CLMC metrics database
+    Creates an Influx DB client for the CLMC metrics database with an empty database
 
     :param telegraf_agent_config: the fixture returning the yaml configuration
     :param request: access the parameters of the fixture
     :return: the created Influx DB client
     """
+   
+    db =  InfluxDBClient(host=telegraf_agent_config['hosts'][0]['ip_address'], port=8086, database=request.param['database'], timeout=10)
+    db.drop_database(request.param['database'])
 
-    return InfluxDBClient(host=telegraf_agent_config['hosts'][0]['ip_address'], port=8086, database=request.param['database'], timeout=10)
+    # wait 20 seconds for the 1st measurement to arrive from agents before returning
+    time.sleep(30)
+
+    return db
diff --git a/clmctest/inputs/rspec.yml b/clmctest/inputs/rspec.yml
index b64c1462cf39d7a156ee28f218d08ffb596d5430..a7ace2852a5e884608f491e3cbb8f93cc19d3e24 100644
--- a/clmctest/inputs/rspec.yml
+++ b/clmctest/inputs/rspec.yml
@@ -35,7 +35,7 @@ hosts:
     service_name: "nginx"
     forward_ports:
       - guest: 80
-        host: 8082
+        host: 8882
     ip_address: "203.0.113.102"
     location: "DC1"
     sfc_id: "MS_Template_1"
@@ -52,7 +52,7 @@ hosts:
     service_name: "mongo"
     forward_ports:
       - guest: 80
-        host: 8083
+        host: 8883
     ip_address: "203.0.113.103"
     location: "DC1"
     sfc_id: "MS_Template_1"
@@ -69,7 +69,7 @@ hosts:
     service_name: "ffmpeg"
     forward_ports:
       - guest: 80
-        host: 8084
+        host: 8884
     ip_address: "203.0.113.104"
     location: "DC1"
     sfc_id: "MS_Template_1"
@@ -86,7 +86,7 @@ hosts:
     service_name: "host"
     forward_ports:
       - guest: 80
-        host: 8085
+        host: 8885
     ip_address: "203.0.113.105"
     location: "DC1"
     sfc_id: "MS_Template_1"
diff --git a/clmctest/monitoring/conftest.py b/clmctest/monitoring/conftest.py
index 828b68c5be2051469b5d5c4c5d52f2b08236cf05..039615224e17aa35ef1cd331425ab9eae55036a5 100644
--- a/clmctest/monitoring/conftest.py
+++ b/clmctest/monitoring/conftest.py
@@ -23,7 +23,7 @@ def streaming_sim_config():
 
 
 @pytest.fixture(params=[{'database': 'CLMCMetrics'}], scope='module')
-def get_db_client(streaming_sim_config, request):
+def influxdb(streaming_sim_config, request):
     """
     Creates an Influx DB client for the CLMC metrics database
 
@@ -32,5 +32,7 @@ def get_db_client(streaming_sim_config, request):
     :return: the created Influx DB client
     """
 
-    return InfluxDBClient(host=streaming_sim_config['hosts'][0]['ip_address'], port=8086, database=request.param['database'], timeout=10)
-
+    db = InfluxDBClient(host=streaming_sim_config['hosts'][0]['ip_address'], port=8086, database=request.param['database'], timeout=10)
+    db.drop_database(request.param['database'])
+    
+    return db
diff --git a/clmctest/monitoring/test_simresults.py b/clmctest/monitoring/test_simresults.py
index 7940fc3a3bc1c97d49d36aedb07cdbb2fcd44ff2..6940560481c30a6d145a52412b7907da4842a5ae 100644
--- a/clmctest/monitoring/test_simresults.py
+++ b/clmctest/monitoring/test_simresults.py
@@ -21,13 +21,13 @@ class TestSimulation(object):
         ('SELECT count(*) FROM "CLMCMetrics"."autogen"."vm_res_alloc"',
          {"time": "1970-01-01T00:00:00Z", "count_cpu": 12, "count_memory": 12, "count_storage": 12})
     ])
-    def test_simulation(self, query, expected_result, get_db_client, run_simulation_fixture):
+    def test_simulation(self, query, expected_result, influxdb, run_simulation_fixture):
         """
         This is the entry point of the test. This method will be found and executed when the module is ran using pytest
 
         :param query: the query to execute (value obtained from the pytest parameter decorator)
         :param expected_result: the result expected from executing the query (value obtained from the pytest parameter decorator)
-        :param get_db_client the import db client fixture - imported from contest.py
+        :param influxdb the import db client fixture - imported from contest.py
         :param run_simulation_fixture: the imported fixture to use to generate the testing data - the return value of the fixture is not needed in this case
         """
 
@@ -36,7 +36,7 @@ class TestSimulation(object):
         print("\n")  # prints a blank line for formatting purposes
 
         # the raise_errors=False argument is given so that we could actually test that the DB didn't return any errors instead of raising an exception
-        query_result = get_db_client.query(query, raise_errors=False)
+        query_result = influxdb.query(query, raise_errors=False)
 
         # test the error attribute of the result is None, that is no error is returned from executing the DB query
         assert query_result.error is None, "An error was encountered while executing query {0}.".format(query)
diff --git a/clmctest/scripts/rspec.yml b/clmctest/scripts/rspec.yml
index 17f1d315febe35757fdddd21a9286861b2263cfa..0de15c5fdecb2fecf1719720ab499020a1382444 100644
--- a/clmctest/scripts/rspec.yml
+++ b/clmctest/scripts/rspec.yml
@@ -3,5 +3,5 @@ hosts:
     cpus: 1
     memory: 2048
     disk: "10GB"
-    ip_address: "200.0.113.150"
+    ip_address: "203.0.113.150"
     
\ No newline at end of file
diff --git a/clmctest/services/apache/install.sh b/clmctest/services/apache/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/ffmpeg/install.sh b/clmctest/services/ffmpeg/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/ffmpeg/transcode.sh b/clmctest/services/ffmpeg/transcode.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/host/install.sh b/clmctest/services/host/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/ipendpoint/install.sh b/clmctest/services/ipendpoint/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/loadtest-streaming/install.sh b/clmctest/services/loadtest-streaming/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/mongo/install.sh b/clmctest/services/mongo/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/nginx/install.sh b/clmctest/services/nginx/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/pytest/install.sh b/clmctest/services/pytest/install.sh
old mode 100644
new mode 100755
diff --git a/clmctest/services/vlc/install.sh b/clmctest/services/vlc/install.sh
old mode 100644
new mode 100755
diff --git a/scripts/build/deleteallvms.sh b/scripts/build/deleteallvms.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4c68a7a733f909b64ddac4610f27a735b7e2d479
--- /dev/null
+++ b/scripts/build/deleteallvms.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+vboxmanage list vms | awk ' {print $1} ' | awk -F',' '{gsub(/"/, "", $1); print $1}' > runningvms
+
+while read vm_id; do
+  echo $vm_id
+  vboxmanage controlvm $vm_id poweroff
+  vboxmanage unregistervm $vm_id --delete
+done <runningvms
+
+rm runningvms
+
diff --git a/scripts/clmc-agent/configure.sh b/scripts/clmc-agent/configure.sh
old mode 100644
new mode 100755
index 483218e6146539b19a3ff395fa2717b68595379d..9ce2c1c36b71ab2c2d910bc78f66ea304234a934
--- a/scripts/clmc-agent/configure.sh
+++ b/scripts/clmc-agent/configure.sh
@@ -24,7 +24,7 @@
 #//
 #/////////////////////////////////////////////////////////////////////////
 
-# Force fail on command fail
+# Force fail on command fail 
 set -euo pipefail
 
 echo "Configuring Telegraf agent general and output configuration"
diff --git a/setup.py b/setup.py
index 7eb4dc603a0e6bef515aabd74442eab2f690111d..7f18cd7528e77be3153107671db448b9d94cd72b 100644
--- a/setup.py
+++ b/setup.py
@@ -6,17 +6,15 @@ def read(fname):
 
 setup(
     name = "clmctest",
-    #version = read('.build-config/git-commit-version'),
     version = "SNAPSHOT",
     author = "Michael Boniface",
     author_email = "mjb@it-innovation.soton.ac.uk",
     description = "FLAME CLMC Testing Module",
     license = "license",
-    keywords = "example documentation",
-    url = "http://packages.python.org/an_example_pypi_project",
+    keywords = "FLAME CLMC test",
     packages=find_packages(exclude=["services"]),
     include_package_data=True,
-    package_data={'': ['*.yml', '*.sh']},        
+    package_data={'': ['git-commit-ref', '*.yml', '*.sh', '*.json', '*.conf']},        
     long_description="long description",
     classifiers=[
         "Development Status :: Alpha",