SRCDIR = $(CURDIR)/src
TESTDIR = $(CURDIR)/test
TESTLIB = $(TESTDIR)/lib
-BUILDDIR = $(CURDIR)/build
+BUILDDIR = $(CURDIR)/build/lib
DISTDIR = $(CURDIR)/dist
-SUBBUILDDIR = $(shell python -c 'import distutils.util, sys; \
- print "lib.%s-%s" % (distutils.util.get_platform(), \
- sys.version[0:3])')
-PYTHON25 := $(shell python -c 'import sys; v = sys.version_info; \
- print (1 if v[0] <= 2 and v[1] <= 5 else 0)')
-
-ifeq ($(PYTHON25),0)
-BUILDDIR := $(BUILDDIR)/$(SUBBUILDDIR)
-else
-BUILDDIR := $(BUILDDIR)/lib
-endif
-
PYPATH = $(BUILDDIR):$(TESTLIB):$(PYTHONPATH)
COVERAGE = $(or $(shell which coverage), $(shell which python-coverage), \
coverage)
PYTHONPATH="$(PYPATH)" $$i -v || retval=$$?; \
done; exit $$retval
+ifeq ($(file),)
+test-one:
+ echo Run $(make) $@ file=test/some/path
+else
test-one: all
echo $(file) $(case)
PYTHONPATH="$(PYPATH)" $(file) $(case)
+endif
+
+test-app:
+ $(MAKE) test-one file=test/resources/linux/application.py case=$(case)
+test-node:
+ $(MAKE) test-one file=test/resources/linux/node.py case=$(case)
coverage: all
rm -f .coverage
rm -f .coverage
clean:
- rm -f `find -name \*.pyc` .coverage *.pcap
+ rm -f $$(find . -name '*.pyc') .coverage *.pcap
rm -rf "$(BUILDDIR)"
distclean: clean
--- /dev/null
+# Test infra setup
+
+As a first attempt to resurrect even if partially some automated tests for nepi, I have
+
+* focused on the unit tests about
+
+* created 2 VMs (in stupeflip)
+* named `fedora` (f22) and `ubuntu` (vivid)
+
+# fedora
+
+ create-vm.sh -f f22 fedora
+ lce fedora
+ adduser inria_nepi
+ yum -y install wget rsync
+ chmod 4755 /bin/ping
+ cat > /etc/sudoers.d/inria_nepi << EOF
+ inria_nepi ALL=(ALL) NOPASSWD: ALL
+ EOF
+
+# ubuntu
+
+Essentially identical, except
+
+* based on vivid (this is 1 week before wily..)
+* `adduser -m inria_nepi` otherwise no homedir is created
+* no need to mess with `ping`
+* `wget` was already there; did install `rsync` although I have no immediate need for it
+
+# results
+
+with all this in place, and with official release 3.2.8 I am getting, referring to `make` targets
+
+* `test-node` : 19 tests passed in 194s
+* `test-app` : 15 tests passed in 170s
+
\ No newline at end of file
class LinuxApplicationTestCase(unittest.TestCase):
def setUp(self):
- self.fedora_host = "nepi2.pl.sophia.inria.fr"
+ self.fedora_host = "fedora.pl.sophia.inria.fr"
self.fedora_user = "inria_nepi"
- self.ubuntu_host = "roseval.pl.sophia.inria.fr"
+ self.ubuntu_host = "ubuntu.pl.sophia.inria.fr"
self.ubuntu_user = "inria_nepi"
- self.target = "nepi5.pl.sophia.inria.fr"
+ self.target = "nepi.pl.sophia.inria.fr"
@skipIfNotAlive
def t_stdout(self, host, user):
ec.set(node, "cleanExperiment", True)
ec.set(node, "cleanProcesses", True)
- sources = "http://yans.pl.sophia.inria.fr/code/nef/archive/tip.tar.gz;" \
- "http://yans.pl.sophia.inria.fr/code/nef/raw-file/8ace577d4079/src/nef/images/menu/connect.png"
+ sources = "http://mirror.onelab.eu/third-party/nepi-tip.tgz;" \
+ "http://mirror.onelab.eu/third-party/nepi-connect.png"
app = ec.register_resource("linux::Application")
ec.set(app, "sources", sources)
self.assertTrue(exitcode.strip() == "0")
out = ec.trace(app, "deploy_stdout")
- self.assertTrue(out.find("tip.tar.gz") > -1)
- self.assertTrue(out.find("connect.png") > -1)
+ self.assertTrue(out.find("nepi-tip.tgz") > -1)
+ self.assertTrue(out.find("nepi-connect.png") > -1)
stdout = ec.trace(app, "stdout")
- self.assertTrue(stdout.find("tip.tar.gz") > -1)
- self.assertTrue(stdout.find("connect.png") > -1)
+ self.assertTrue(stdout.find("nepi-tip.tgz") > -1)
+ self.assertTrue(stdout.find("nepi-connect.png") > -1)
ec.shutdown()
class LinuxNodeTestCase(unittest.TestCase):
def setUp(self):
- self.fedora_host = "nepi2.pl.sophia.inria.fr"
+ self.fedora_host = "fedora.pl.sophia.inria.fr"
self.fedora_user = "inria_nepi"
- self.ubuntu_host = "roseval.pl.sophia.inria.fr"
+ self.ubuntu_host = "ubuntu.pl.sophia.inria.fr"
self.ubuntu_user = "inria_nepi"
- self.target = "nepi5.pl.sophia.inria.fr"
+ self.target = "nepi.pl.sophia.inria.fr"
@skipIfNotAlive
def t_execute(self, host, user):