Add's support for Juniper Contrail packaging + test-kitchen (#2)

* Add's support for Juniper packaging
 - handle vendor packaging differences
 - map.jina loaded from yaml
 - test kitchen validation on Travis
 - multiple test/pillars fixtures
 - .kitchen.vagrant.yml for tests not passing on docker
 - fix, remove virtual package name as full is required

* Fix epcim complains about non reclass usage test

Change-Id: I7b4892cce1063f583b045954b6b64b30d3b01a65

* Update contrail-vrouter-agent.conf for lbaas

* Juniper: Allow downgrades while installing pkgs on controller nodes; precreate cassandra data dir
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 29e22c9..ada4df8 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -68,6 +68,7 @@
   control:
     version: 3.0
     enabled: true
+    name: ntw-01
     bind:
       address: 127.0.0.1
     discovery:
@@ -126,6 +127,8 @@
   web:
     version: 3.0
     enabled: True
+    network:
+      host: 127.0.0.1
     bind:
       address: 127.0.0.1
     master:
diff --git a/tests/pillar/control.sls b/tests/pillar/control.sls
index 3ba9d34..1ae5ac9 100644
--- a/tests/pillar/control.sls
+++ b/tests/pillar/control.sls
@@ -65,6 +65,7 @@
   control:
     version: 3.0
     enabled: true
+    name: ntw-01
     bind:
       address: 127.0.0.1
     discovery:
@@ -79,7 +80,7 @@
     - host: 127.0.0.1
       id: 3
   database:
-    version: 127.0.0.1
+    version: 3.0
     cassandra:
       version: 2
     enabled: true
@@ -105,6 +106,8 @@
   web:
     version: 3.0
     enabled: True
+    network:
+      host: 127.0.0.1
     bind:
       address: 127.0.0.1
     analytics:
diff --git a/tests/pillar/repo_cassandra.sls b/tests/pillar/repo_cassandra.sls
new file mode 100644
index 0000000..8ece8a8
--- /dev/null
+++ b/tests/pillar/repo_cassandra.sls
@@ -0,0 +1,9 @@
+linux:
+  system:
+    repo:
+      cassandra-21x:
+        source: "deb [arch=amd64] http://www.apache.org/dist/cassandra/debian 21x main"
+        architectures: amd64
+        key_server: pool.sks-keyservers.net
+        key_id: A278B781FE4B2BDA
+
diff --git a/tests/pillar/repo_mos8.sls b/tests/pillar/repo_mos8.sls
new file mode 100644
index 0000000..3b53e53
--- /dev/null
+++ b/tests/pillar/repo_mos8.sls
@@ -0,0 +1,23 @@
+linux:
+  system:
+    repo:
+      mirantis_openstack:
+        source: "deb [arch=amd64] http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/ mos8.0 main restricted"
+        architectures: amd64
+        key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/archive-mos8.0.key"
+      #mirantis_openstack_hotfix:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/ mos8.0-hotfix main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/archive-mos8.0.key"
+      #mirantis_openstack_proposed:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/ mos8.0-proposed main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/archive-mos8.0.key"
+      #mirantis_openstack_security:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/ mos8.0-security main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/archive-mos8.0.key"
+      #mirantis_openstack_updates:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/ mos8.0-updates main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0-mu-3/archive-mos8.0.key"
diff --git a/tests/pillar/repo_mos9.sls b/tests/pillar/repo_mos9.sls
new file mode 100644
index 0000000..90df22d
--- /dev/null
+++ b/tests/pillar/repo_mos9.sls
@@ -0,0 +1,19 @@
+linux:
+  system:
+    repo:
+      mirantis_openstack:
+        source: "deb [arch=amd64] http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/ mos9.0 main restricted"
+        architectures: amd64
+        key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/archive-mos9.0.key"
+      #mirantis_openstack_hotfix:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/ mos9.0-hotfix main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/archive-mos9.0.key"
+      #mirantis_openstack_security:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/ mos9.0-security main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/archive-mos9.0.key"
+      #mirantis_openstack_updates:
+        #source: "deb http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/ mos9.0-updates main restricted"
+        #architectures: amd64
+        #key_url: "http://mirror.fuel-infra.org/mos-repos/ubuntu/9.0/archive-mos9.0.key"
diff --git a/tests/pillar/single.sls b/tests/pillar/single.sls
index faba0dc..e04824e 100644
--- a/tests/pillar/single.sls
+++ b/tests/pillar/single.sls
@@ -54,6 +54,7 @@
     - host: 127.0.0.1
       id: 1
   control:
+    name: ntw-01
     version: 3.0
     enabled: true
     bind:
@@ -102,6 +103,8 @@
   web:
     version: 3.0
     enabled: True
+    network:
+      host: 127.0.0.1
     bind:
       address: 127.0.0.1
     analytics:
diff --git a/tests/pillar/tor.sls b/tests/pillar/tor.sls
index a14ce11..04ecba0 100644
--- a/tests/pillar/tor.sls
+++ b/tests/pillar/tor.sls
@@ -21,3 +21,15 @@
       address: 127.0.0.1
     device:
       host: 127.0.0.1
+  compute:
+    enabled: true
+    version: 3.0
+    discovery:
+      host: 127.0.0.1
+    interface:
+      address: 127.0.0.1
+      dev: eth0
+      gateway: 127.0.0.1
+      mask: /24
+      dns: 127.0.0.1
+      mtu: 9000
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 8c07e58..a4cac88 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -44,6 +44,7 @@
     [ ! -d ${SALT_PILLAR_DIR} ] && mkdir -p ${SALT_PILLAR_DIR}
     echo "base:" > ${SALT_PILLAR_DIR}/top.sls
     for pillar in ${PILLARDIR}/*; do
+        grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
         state_name=$(basename ${pillar%.sls})
         echo -e "  ${state_name}:\n    - ${state_name}" >> ${SALT_PILLAR_DIR}/top.sls
     done
@@ -56,6 +57,7 @@
 
     echo "base:" > ${SALT_FILE_DIR}/top.sls
     for pillar in ${PILLARDIR}/*.sls; do
+        grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
         state_name=$(basename ${pillar%.sls})
         echo -e "  ${state_name}:\n    - ${FORMULA_NAME}" >> ${SALT_FILE_DIR}/top.sls
     done
@@ -126,6 +128,7 @@
 
 run() {
     for pillar in ${PILLARDIR}/*.sls; do
+        grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
         state_name=$(basename ${pillar%.sls})
         salt_run --id=${state_name} state.show_sls ${FORMULA_NAME} || (log_err "Execution of ${FORMULA_NAME}.${state_name} failed"; exit 1)
     done