Test: Gradle and ansible scripts to deploy and run cord test verify.

Change-Id: Iac6e14819072b5b6bc1de53332023366f5dcb411
diff --git a/build.gradle b/build.gradle
index 7737296..4fcd370 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,6 +13,26 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import org.opencord.gradle.rules.*
+import org.yaml.snakeyaml.Yaml
+
+allprojects {
+    apply plugin: 'base'
+    apply plugin: 'de.gesellix.docker'
+    //apply plugin: 'com.tmiyamon.config'
+
+    docker {
+        // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock'
+        // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
+        // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default"
+        // authConfigPlain = [
+        //   "username"       : "joe",
+        //   "password"       : "some-pw-as-needed",
+        //   "email"          : "joe@acme.com",
+        //   "serveraddress"  : "https://index.docker.io/v1/"
+        //  ]
+    }
+}
 
 ext {
 
@@ -22,6 +42,10 @@
     // The tag used to tag the docker images push to the target registry
     targetTag = project.hasProperty('targetTag') ? project.getProperty('targetTag') : 'candidate'
 
+    // Deployment target config file (yaml format); this can be overwritten from the command line
+    // using the -PdeployConfig=<file-path> syntax.
+    deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'
+
     cordTesterPath = project.hasProperty('cordTesterPath') ? project.getProperty('cordTesterPath') : './src/test/setup'
 
     dockerPath = project.hasProperty('dockerPath') ? project.getProperty('dockerPath') : '/usr/bin'
@@ -103,3 +127,119 @@
 task publish {
     dependsOn publishImages
 }
+
+task deployBase (type: Exec) {
+    println "Using deployment config: $deployConfig"
+    File configFile = new File(deployConfig)
+    def yaml = new Yaml()
+    def config = yaml.load(configFile.newReader())
+
+    executable = "ansible-playbook"
+    args = ["-i", config.seedServer.ip + ',']
+
+    if ( config.seedServer.user != null && config.seedServer.user != "" ) {
+        args = args << "--user=$config.seedServer.user"
+    }
+
+
+    if ( config.debug ) {
+        args = args << "-vvvv"
+    }
+
+    def extraVars = []
+    if (config.seedServer) {
+        extraVars = extraVars.p(config.seedServer.extraVars)
+            .p(config.seedServer.password, "ansible_ssh_pass")
+            .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
+            .p(config.seedServer.fabric_ip, "fabric_ip")
+	    .p(config.seedServer.management_ip, "management_ip")
+            .p(config.seedServer.management_gw, "management_gw")
+            .p(config.seedServer.management_network, "management_network")
+	    .p(config.seedServer.management_iface, "management_iface")
+	    .p(config.seedServer.external_ip, "external_ip")
+            .p(config.seedServer.external_gw, "external_gw")
+            .p(config.seedServer.external_network, "external_network")
+            .p(config.seedServer.external_iface, "external_iface")
+	    .p(config.seedServer.fabric_ip, "fabric_ip")
+	    .p(config.seedServer.fabric_network, "fabric_network")
+	    .p(config.seedServer.fabric_iface, "fabric_iface")
+            .p(config.seedServer.domain, "domain")
+            .p(config.seedServer.virtualbox_support, "virtualbox_support")
+	    .p(config.seedServer.power_helper_user, "power_helper_user")
+	    .p(config.seedServer.power_helper_host, "power_helper_host")
+            .p(config.seedServer.port, "ansible_ssh_port")
+    }
+
+    if (config.otherServers) {
+        extraVars = extraVars.p(config.otherServers.location, "prov_location")
+        .p(config.otherServers.rolesPath, "prov_role_path")
+        .p(config.otherServers.role, "prov_role")
+    }
+
+    if (config.docker) {
+        extraVars = extraVars.p(config.docker.registry, "docker_registry")
+            .p(config.docker.imageVersion, "docker_image_version")
+    }
+
+    def skipTags = [].p(config.seedServer.skipTags)
+
+    args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "cord-tester-deploy.yml"
+}
+
+task verify (type: Exec) {
+    println "Using deployment config: $deployConfig"
+    File configFile = new File(deployConfig)
+    def yaml = new Yaml()
+    def config = yaml.load(configFile.newReader())
+
+    executable = "ansible-playbook"
+    args = ["-i", config.seedServer.ip + ',']
+
+    if ( config.seedServer.user != null && config.seedServer.user != "" ) {
+        args = args << "--user=$config.seedServer.user"
+    }
+
+
+    if ( config.debug ) {
+        args = args << "-vvvv"
+    }
+
+    def extraVars = []
+    if (config.seedServer) {
+        extraVars = extraVars.p(config.seedServer.extraVars)
+            .p(config.seedServer.password, "ansible_ssh_pass")
+            .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
+            .p(config.seedServer.fabric_ip, "fabric_ip")
+	    .p(config.seedServer.management_ip, "management_ip")
+            .p(config.seedServer.management_gw, "management_gw")
+            .p(config.seedServer.management_network, "management_network")
+	    .p(config.seedServer.management_iface, "management_iface")
+	    .p(config.seedServer.external_ip, "external_ip")
+            .p(config.seedServer.external_gw, "external_gw")
+            .p(config.seedServer.external_network, "external_network")
+            .p(config.seedServer.external_iface, "external_iface")
+	    .p(config.seedServer.fabric_ip, "fabric_ip")
+	    .p(config.seedServer.fabric_network, "fabric_network")
+	    .p(config.seedServer.fabric_iface, "fabric_iface")
+            .p(config.seedServer.domain, "domain")
+            .p(config.seedServer.virtualbox_support, "virtualbox_support")
+	    .p(config.seedServer.power_helper_user, "power_helper_user")
+	    .p(config.seedServer.power_helper_host, "power_helper_host")
+            .p(config.seedServer.port, "ansible_ssh_port")
+    }
+
+    if (config.otherServers) {
+        extraVars = extraVars.p(config.otherServers.location, "prov_location")
+        .p(config.otherServers.rolesPath, "prov_role_path")
+        .p(config.otherServers.role, "prov_role")
+    }
+
+    if (config.docker) {
+        extraVars = extraVars.p(config.docker.registry, "docker_registry")
+            .p(config.docker.imageVersion, "docker_image_version")
+    }
+
+    def skipTags = [].p(config.seedServer.skipTags)
+
+    args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "cord-tester-verify.yml"
+}
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
new file mode 100644
index 0000000..cbb6652
--- /dev/null
+++ b/buildSrc/build.gradle
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'groovy'
+
+repositories {
+    // maven { url 'https://repo.gradle.org/gradle/libs' }
+    maven { url 'https://plugins.gradle.org/m2/' }
+    // mavenCentral()
+}
+
+dependencies {
+    compile gradleApi()
+    compile localGroovy()
+    compile 'de.gesellix:gradle-docker-plugin:2016-05-05T13-15-11'
+    compile 'org.yaml:snakeyaml:1.10'
+    //compile 'gradle.plugin.com.tmiyamon:gradle-config:0.2.1'
+}
diff --git a/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerFetchRule.groovy b/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerFetchRule.groovy
new file mode 100644
index 0000000..a9bb91b
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerFetchRule.groovy
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opencord.gradle.rules
+
+import org.gradle.api.Rule
+import de.gesellix.gradle.docker.tasks.DockerPullTask
+
+
+/**
+ * Gradle Rule class to fetch a docker image
+ */
+class DockerFetchRule implements Rule {
+
+    def project
+
+    DockerFetchRule(project) {
+        this.project = project
+    }
+
+    String getDescription() {
+        'Rule Usage: fetch<component-name>'
+    }
+
+    void apply(String taskName) {
+        if (taskName.startsWith('fetch')) {
+            project.task(taskName, type: DockerPullTask) {
+                ext.compName = taskName - 'fetch'
+                def spec = project.comps[ext.compName]
+                imageName = spec.name + '@' + spec.digest
+            }
+        }
+    }
+}
diff --git a/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerPublishRule.groovy b/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerPublishRule.groovy
new file mode 100644
index 0000000..a1d8164
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerPublishRule.groovy
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opencord.gradle.rules
+
+import org.gradle.api.Rule
+import de.gesellix.gradle.docker.tasks.DockerPushTask
+
+
+/**
+ * Gradle Rule class to publish (push) a docker image to a private repo
+ */
+class DockerPublishRule implements Rule {
+
+    def project
+
+    DockerPublishRule(project) {
+        this.project = project
+    }
+
+    String getDescription() {
+        'Rule Usage: publish<component-name>'
+    }
+
+    void apply(String taskName) {
+        if (taskName.startsWith('publish')) {
+            project.task(taskName, type: DockerPushTask) {
+                ext.compName = taskName - 'publish'
+                println "Publish rule: $taskName + $compName"
+                def tagTask = "tag$compName"
+                println "Tagtask: $tagTask"
+                dependsOn tagTask
+                def spec = project.comps[ext.compName]
+                repositoryName = spec.name + ':' + project.targetTag
+                registry = project.targetReg
+            }
+        }
+    }
+}
diff --git a/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerTagRule.groovy b/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerTagRule.groovy
new file mode 100644
index 0000000..474e16d
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/opencord/gradle/rules/DockerTagRule.groovy
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opencord.gradle.rules
+
+import org.gradle.api.Rule
+import de.gesellix.gradle.docker.tasks.DockerTagTask
+
+
+/**
+ * Gradle Rule class to tag a docker image
+ */
+class DockerTagRule implements Rule {
+
+    def project
+
+    DockerTagRule(project) {
+        this.project = project
+    }
+
+    String getDescription() {
+        'Rule Usage: tag<component-name>'
+    }
+
+    void apply(String taskName) {
+        if (taskName.startsWith('tag') && !taskName.equals('tag')) {
+            project.task(taskName, type: DockerTagTask) {
+                ext.compName = taskName - 'tag'
+                def spec = project.comps[compName]
+                imageId = spec.name + '@' + spec.digest
+                tag = compName + ':' + project.targetTag
+            }
+        }
+    }
+}
diff --git a/buildSrc/src/main/groovy/org/opencord/gradle/rules/GitSubmoduleUpdateRule.groovy b/buildSrc/src/main/groovy/org/opencord/gradle/rules/GitSubmoduleUpdateRule.groovy
new file mode 100644
index 0000000..3b46424
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/opencord/gradle/rules/GitSubmoduleUpdateRule.groovy
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2012 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opencord.gradle.rules
+
+import org.gradle.api.Rule
+import org.gradle.api.tasks.Exec
+
+
+/**
+ * Gradle Rule class to fetch a docker image
+ */
+class GitSubmoduleUpdateRule implements Rule {
+
+    def project
+
+    GitSubmoduleUpdateRule(project) {
+        this.project = project
+    }
+
+    String getDescription() {
+        'Rule Usage: gitupdate<component-name>'
+    }
+
+    void apply(String taskName) {
+        if (taskName.startsWith('gitupdate')) {
+            project.task(taskName, type: Exec) {
+                ext.compName = taskName - 'gitupdate'
+                def spec = project.comps[ext.compName]
+                workingDir = '.'
+                commandLine '/usr/bin/git', 'submodule', 'update', '--init', '--recursive', spec.componentDir
+            }
+        }
+    }
+}
diff --git a/config/default.yml b/config/default.yml
new file mode 100644
index 0000000..6503c5c
--- /dev/null
+++ b/config/default.yml
@@ -0,0 +1,48 @@
+# Deployment configuration for VirtualBox based head node.
+#
+# This deployment configuration can be utilized with the head node created
+# via `vargrant up headnode` from the gerrit.opencord.org/maas repository.
+---
+seedServer:
+  ip: '10.100.198.201'
+
+  # User name and password used by Ansible to connect to the host for remote
+  # provisioning
+  user: 'vagrant'
+  password: 'vagrant'
+
+  # Specifies tasks within the head node provisioning not to execute, including:
+  #
+  # switch_support -   don't download the switch ONL images as there are no
+  #                    switches in this configuration
+  # interface_config - don't update the network configuration of the headnode
+  #                    as it is configured by vagrant to the proper settings
+  skipTags:
+    - 'switch_support'
+    - 'interface_config'
+
+  management_ip: '10.1.0.1/24'
+  management_iface: 'eth2'
+  external_iface: 'eth0'
+  management_network: '10.1.0.0/24'
+
+  # Specifies the extra settings required for this configuration
+  #
+  # virtualbox_support - install support for managing virtual box based
+  #                      compute nodes
+  virtualbox_support: 1
+  power_helper_user: 'cord'
+
+docker:
+  imageVersion: 'candidate'
+  registry: 'docker-registry:5000'
+
+otherServers:
+  # Specifies the configuration for dynamically added compute nodes
+  location: 'http://gerrit.opencord.org/maas'
+  rolesPath: 'roles'
+  role: 'compute-node'
+  fabric:
+    network: '10.1.1.1/24'
+    range_low: '10.1.1.2'
+    range_high: '10.1.1.253'
diff --git a/config/develop.yml b/config/develop.yml
new file mode 100644
index 0000000..a42e9e8
--- /dev/null
+++ b/config/develop.yml
@@ -0,0 +1,40 @@
+# Deployment configuration for VirtualBox based head node.
+#
+# This deployment configuration can be utilized with the head node created
+# via `vargrant up headnode` from the gerrit.opencord.org/maas repository.
+---
+seedServer:
+  ip: '10.100.198.202'
+
+  # User name and password used by Ansible to connect to the host for remote
+  # provisioning
+  user: 'vagrant'
+  password: 'vagrant'
+
+  # Specifies tasks within the head node provisioning not to execute, including:
+  #
+  # switch_support -   don't download the switch ONL images as there are no 
+  #                    switches in this configuration
+  # interface_config - don't update the network configuration of the headnode
+  #                    as it is configured by vagrant to the proper settings
+  skipTags:
+    - 'switch_support'
+    - 'interface_config'
+
+  # Specifies the extra settings required for this configuration
+  #
+  # virtualbox_support - install support for managing virtual box based
+  #                      compute nodes
+  extraVars:
+    - 'virtualbox_support=1'
+    - 'external_iface=eth0'
+
+otherServers:
+  # Specifies the configuration for dynamically added compute nodes
+  location: 'http://gerrit.opencord.org/maas'
+  rolesPath: 'roles'
+  role: 'compute-node'
+
+docker:
+  registry: '10.100.198.200:5000/opencord'
+  imageVersion: 'candidate'
diff --git a/config/pod5.yml b/config/pod5.yml
new file mode 100644
index 0000000..c54f9c4
--- /dev/null
+++ b/config/pod5.yml
@@ -0,0 +1,36 @@
+# Deployment configuration for a phyical hardware POD
+---
+seedServer:
+  ip: '47.135.132.21'
+  # User name and password used by Ansible to connect to the host for remote
+  # provisioning
+  user: 'ubuntu'
+  password: 'ubuntu'
+
+  # Network address information for the head node:
+  #
+  # fabric_ip     - the IP address and mask bits to be used to configure the network
+  #                 interface connected to the leaf - spine fabric
+  #
+  # management_ip - the IP address and mask bits to be used to configure the network
+  #                 interface connecting the head node to the POD internal
+  #                 management network. The head node will deliver DHCP addresses to 
+  #                 the other compute nodes over this interface
+  #
+  # external_ip   - the IP address and mask bits to be used to configure the network
+  #                 interface connecting the head node (and the POD) to the 
+  #                 Internet. All traffic in the POD to external hosts will be 
+  #                 NAT-ed through this interface
+  fabric_ip: '10.6.1.1/24'
+  management_ip: '10.6.0.1/24'
+  external_ip: '47.135.132.21/24'
+
+otherNodes:
+  # Experimental
+  #
+  # Specifies the subnet and address range that will be used to allocate IP addresses
+  # to the compute nodes as they are deployed into the POD.
+  fabric:
+    network: 10.6.1.1/24
+    range_low: 10.6.1.2
+    range_high: 10.6.1.253
diff --git a/cord-tester-deploy.yml b/cord-tester-deploy.yml
new file mode 100644
index 0000000..ab52738
--- /dev/null
+++ b/cord-tester-deploy.yml
@@ -0,0 +1,29 @@
+---
+- hosts: localhost
+  tasks:
+    - name: Archive cord tester files
+      local_action: shell tar -cvzf /tmp/cord-tester.tar.gz ../cord-tester --exclude=.git
+
+- hosts: all
+  tasks:
+    - name: Unarchive cord tester files
+      unarchive:
+        src=/tmp/cord-tester.tar.gz
+        dest=/home/{{ ansible_user }}
+        owner={{ ansible_user }}
+        group={{ ansible_user }}
+
+    - name: Cleanup remote archive files
+      file:
+        path=/home/{{ ansible_user }}/.ansible state=absent
+
+- hosts: localhost
+  tasks:
+    - name: Cleanup local archive files
+      file:
+        path=/tmp/cord-tester.tar.gz state=absent
+
+- name: Run prerequisites on head node
+  hosts: all
+  roles:
+    - prereq
diff --git a/cord-tester-verify.yml b/cord-tester-verify.yml
new file mode 100644
index 0000000..1ac201f
--- /dev/null
+++ b/cord-tester-verify.yml
@@ -0,0 +1,6 @@
+---
+- hosts: all
+  tasks:
+    - name: Run fabric tests using cord-tester
+      become: yes
+      command: "/home/{{ ansible_user }}/cord-tester/src/test/setup/cord-test.py run -e onos-fabric/onos-fabric --no-switch --prefix=docker-registry:5000 -t fabric"
\ No newline at end of file
diff --git a/roles/prereq/defaults/main.yml b/roles/prereq/defaults/main.yml
new file mode 100644
index 0000000..731d94f
--- /dev/null
+++ b/roles/prereq/defaults/main.yml
@@ -0,0 +1,14 @@
+#
+# variables needed to be defined in user's playbook
+#
+#
+# user-configurable defaults
+#
+# default install path
+docker_tools_path: '/usr/local/bin'
+docker_tools_pipework_exe_url: https://raw.githubusercontent.com/jpetazzo/pipework/master/pipework
+
+#docker variables
+docker:
+    registry: "{{ docker_registry | default('docker-registry:5000') }}"
+    image_version: "{{ docker_image_version | default('latest') }}"
\ No newline at end of file
diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml
new file mode 100644
index 0000000..f8026ec
--- /dev/null
+++ b/roles/prereq/tasks/main.yml
@@ -0,0 +1,61 @@
+---
+- name: Install Cord tester prerequisites
+  become: yes
+  apt: name={{ item }} state=latest force=yes
+  with_items:
+    - wget
+    - python
+    - python-dev
+    - python-pip
+    - python-setuptools
+    - python-scapy
+    - python-pexpect
+    - openvswitch-switch
+
+- name: Install Python Prerequisites for cord tester
+  become: yes
+  pip: name={{ item }} state=latest
+  with_items:
+    - nose
+    - scapy
+    - monotonic
+    - configObj
+    - docker-py
+    - pyyaml
+    - nsenter
+    - pyroute2
+    - netaddr
+    - python-daemon
+    - scapy-ssl_tls
+
+- name: install Pipework
+  sudo: True
+  get_url:
+    url: "{{ docker_tools_pipework_exe_url }}"
+    dest: "{{ docker_tools_path }}/pipework"
+    force: yes
+    mode: "a+x"
+
+- name: Pull cord test container
+  become: yes
+  docker:
+    name: cord-test
+    image: "{{ docker.registry }}/cord-test/nose:{{ docker.image_version }}"
+    pull: always
+    state: absent
+
+- name: Pull test radius container
+  become: yes
+  docker:
+    name: cord-radius
+    image: "{{ docker.registry }}/cord-test/radius:{{ docker.image_version }}"
+    pull: always
+    state: absent
+
+- name: Pull test quagga container
+  become: yes
+  docker:
+    name: cord-quagga
+    image: "{{ docker.registry }}/cord-test/quagga:{{ docker.image_version }}"
+    pull: always
+    state: absent
diff --git a/settings.gradle b/settings.gradle
deleted file mode 100644
index 0acd147..0000000
--- a/settings.gradle
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * This settings file was auto generated by the Gradle buildInit task
- * by 'zsolt' at '6/1/16 3:52 PM' with Gradle 2.12
- *
- * The settings file is used to specify which projects to include in your build.
- * In a single project build this file can be empty or even removed.
- *
- * Detailed information about configuring a multi-project build in Gradle can be found
- * in the user guide at https://docs.gradle.org/2.12/userguide/multi_project_builds.html
- */
-
-/*
-// To declare projects as part of a multi-project build use the 'include' method
-include 'shared'
-include 'api'
-include 'services:webservice'
-*/
-
-rootProject.name = 'cord-tester'
diff --git a/src/test/utils/CordContainer.py b/src/test/utils/CordContainer.py
index 11f257b..63443b9 100644
--- a/src/test/utils/CordContainer.py
+++ b/src/test/utils/CordContainer.py
@@ -114,7 +114,7 @@
         return '/{0}'.format(self.name) in list(flatten(n['Names'] for n in self.dckr.containers()))
 
     def img_exists(self):
-        return self.image_name[len(self.prefix):] in [ctn['RepoTags'][0] for ctn in self.dckr.images()]
+        return self.image_name in [ctn['RepoTags'][0] if ctn['RepoTags'] else '' for ctn in self.dckr.images()]
 
     def ip(self):
         cnt_list = filter(lambda c: c['Image'] == self.image_name, self.dckr.containers())