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/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