Test: Review changes.
Remove sudo dependency from fetch phase of gradle for cord-tester.
Build all cord-tester docker images locally without using the cord-test.py interface.

Change-Id: Ib00f6d8c854900eaf77f97da0d9e090511aa4ed8
diff --git a/Dockerfile.quagga b/Dockerfile.quagga
new file mode 100644
index 0000000..1f12f9a
--- /dev/null
+++ b/Dockerfile.quagga
@@ -0,0 +1,13 @@
+FROM ubuntu:14.04
+MAINTAINER chetan@ciena.com
+WORKDIR /root
+RUN useradd -M quagga
+RUN mkdir /var/log/quagga && chown quagga:quagga /var/log/quagga
+RUN mkdir /var/run/quagga && chown quagga:quagga /var/run/quagga
+RUN apt-get update && apt-get install -qy git autoconf libtool gawk make telnet libreadline6-dev
+RUN git clone git://git.sv.gnu.org/quagga.git quagga && \
+(cd quagga && git checkout HEAD && ./bootstrap.sh && \
+sed -i -r 's,htonl.*?\(INADDR_LOOPBACK\),inet_addr\("10.10.0.4"\),g' zebra/zebra_fpm.c && \
+./configure --enable-fpm --disable-doc --localstatedir=/var/run/quagga && make && make install)
+RUN ldconfig
+CMD [ "/bin/bash" ]
\ No newline at end of file
diff --git a/Dockerfile.radius b/Dockerfile.radius
new file mode 100644
index 0000000..da7aaf1
--- /dev/null
+++ b/Dockerfile.radius
@@ -0,0 +1,6 @@
+FROM hbouvier/docker-radius:latest
+MAINTAINER chetan@ciena.com
+RUN apt-get update && \
+    apt-get -y install python python-pexpect strace
+WORKDIR /root
+CMD ["radius"]
diff --git a/Dockerfile.tester b/Dockerfile.tester
new file mode 100644
index 0000000..e36faad
--- /dev/null
+++ b/Dockerfile.tester
@@ -0,0 +1,37 @@
+FROM ubuntu:14.04
+MAINTAINER chetan@ciena.com
+RUN apt-get update  && \
+    apt-get install -y git git-core autoconf automake autotools-dev pkg-config \
+        make gcc g++ libtool libc6-dev cmake libpcap-dev libxerces-c2-dev  \
+        unzip libpcre3-dev flex bison libboost-dev \
+        python python-pip python-setuptools python-scapy tcpdump doxygen doxypy wget \
+        openvswitch-common openvswitch-switch \
+        python-twisted python-sqlite sqlite3 python-pexpect telnet arping
+RUN easy_install nose
+RUN mkdir -p /root/ovs
+WORKDIR /root
+RUN wget http://openvswitch.org/releases/openvswitch-2.5.0.tar.gz -O /root/ovs/openvswitch-2.5.0.tar.gz && \
+(cd /root/ovs && tar zxpvf openvswitch-2.5.0.tar.gz && \
+ cd openvswitch-2.5.0 && \
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-ssl && make && make install)
+RUN service openvswitch-switch restart || /bin/true
+RUN pip install -U scapy scapy-ssl_tls monotonic configObj docker-py pyyaml nsenter pyroute2 netaddr
+RUN mv /usr/sbin/tcpdump /sbin/
+RUN ln -sf /sbin/tcpdump /usr/sbin/tcpdump
+WORKDIR /root
+RUN wget -nc http://de.archive.ubuntu.com/ubuntu/pool/main/b/bison/bison_2.5.dfsg-2.1_amd64.deb \
+         http://de.archive.ubuntu.com/ubuntu/pool/main/b/bison/libbison-dev_2.5.dfsg-2.1_amd64.deb
+RUN sudo dpkg -i bison_2.5.dfsg-2.1_amd64.deb libbison-dev_2.5.dfsg-2.1_amd64.deb
+RUN rm bison_2.5.dfsg-2.1_amd64.deb libbison-dev_2.5.dfsg-2.1_amd64.deb
+RUN wget -nc http://www.nbee.org/download/nbeesrc-jan-10-2013.zip && \
+    unzip nbeesrc-jan-10-2013.zip && \
+    cd nbeesrc-jan-10-2013/src && cmake . && make && \
+    cp ../bin/libn*.so /usr/local/lib && ldconfig && \
+    cp -R ../include/* /usr/include/
+WORKDIR /root
+RUN git clone https://github.com/CPqD/ofsoftswitch13.git && \
+    cd ofsoftswitch13 && \
+    ./boot.sh && \
+    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-ssl && \
+    make && make install
+CMD ["/bin/bash"]
diff --git a/build.gradle b/build.gradle
index ad078ef..6ef8a83 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,47 +26,27 @@
 
     dockerPath = project.hasProperty('dockerPath') ? project.getProperty('dockerPath') : '/usr/bin'
 
-    cordTesterAptDeps = [ 'python', 'python-dev', 'python-pip', 'python-setuptools' ]
-
-    cordTesterPipDeps = [ 'scapy', 'nose', 'monotonic', 'configObj', 'docker-py', 'pyyaml', 'nsenter', 'pyroute2', 'netaddr', 'scapy-ssl_tls' ]
+    cordTesterImages = [ 'cord-test/radius:latest' : 'Dockerfile.radius', 'cord-test/quagga:latest' : 'Dockerfile.quagga', 'cord-test/nose:latest' : 'Dockerfile.tester' ]
 }
 
 // ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
 
-task aptFetch() {
-    // fetch the dependencies for cord tester
-    cordTesterAptDeps.each {
-        String pkg ->
-        exec {
-            executable 'apt-get'
-            args "install", "-y", pkg
-        }
-    }
-}
-
-task pipFetch() {
-    // fetch the dependencies for cord tester
-    dependsOn aptFetch
-    cordTesterPipDeps.each {
-        String pkg ->
-        exec {
-            executable 'pip'
-            args "install", "-U", pkg
-        }
-    }
-}
-
 // To be used to fetch upstream binaries, clone repos, etc.
-task fetch (type: Exec) {
-    dependsOn pipFetch
-    commandLine "$cordTesterPath/onos_pull.sh", 'latest'
+task fetch {
+    //commandLine "$cordTesterPath/onos_pull.sh", 'latest'
 }
 
 // To be used to generate all needed binaries that need to be present on the target
 // as docker images in the local docker runner.
-task buildImages (type: Exec) {
+task buildImages {
     // ...
-    commandLine "$cordTesterPath/cord-test.py", 'build', 'all'
+    cordTesterImages.each { tag, dockerfile ->
+        println "Building Docker image ${tag} using ${dockerfile}"
+        exec {
+             executable "$dockerPath/docker"
+             args "build", "-t", "${tag}", "-f", "${dockerfile}", "."
+        }
+    }
 }
 
 // Publish image(s) built during the build step into targetReg registry using the targetTag