DESTDIR="/"
##########
-all: python wsdl
+all: python wsdl
-install: python-install wsdl-install xmlbuilder-install
+install: python-install wsdl-install xmlbuilder-install tests-install
-clean: python-clean wsdl-clean
+clean: python-clean wsdl-clean
-uninstall: python-uninstall
+uninstall: python-uninstall tests-uninstall
-.PHONY: all install clean
+.PHONY: all install clean uninstall
##########
python:
.PHONY: wsdl wsdl-install wsdl-clean
+
+##########
+tests-install:
+ mkdir -p $(DESTDIR)/usr/share/sfa/tests
+ install -m 755 tests/*.py $(DESTDIR)/usr/share/sfa/tests/
+
+tests-uninstall:
+ rm -rf $(DESTDIR)/usr/share/sfa/tests
+
+.PHONY: tests-install tests-uninstall
+
########## refreshing methods package metafile
# Metafiles - manage Legacy/ and Accessors by hand
init := sfa/methods/__init__.py
#%endif
%package cm
-Summary: the SFA wrapper around MyPLC's NodeManager
+Summary: the SFA wrapper around MyPLC NodeManager
Group: Applications/System
Requires: sfa
Requires: pyOpenSSL >= 0.6
Group: Applications/System
Requires: sfa
+%Package tests
+Summary: unit tests suite for SFA
+Group: Applications/System
+Requires: sfa
+
%description
This package provides the python libraries that the SFA implementation requires
in an SFA network, in much the same way as iptables is for ip
networks. This is the command line interface to manage sfatables
+%description tests
+Provides some binary unit tests in /usr/share/sfa/tests
+
%prep
%setup -q
%files sfatables
%{_bindir}/sfatables
+%files tests
+%{_datadir}/sfa/tests
+
### sfa-plc installs the 'sfa' service
%post plc
chkconfig --add sfa
def test_hrn010(self):
self.__hrn("plc.vini.site", 'authority',
"urn:publicid:IDN+plc:vini:site+authority+sa" )
-
+
+ # this one is a bit off limits but it's used in some places
+ # like .e.g when running sfi.py resources
+ def test_void(self):
+ void=Xrn(xrn='',type=None)
+ expected='urn:publicid:IDN++'
+ self.assertEqual(void.get_hrn(),'')
+ self.assertEqual(void.get_type(),None)
+ self.assertEqual(void.get_urn(),expected)
+ loop=Xrn(urn=expected)
+ self.assertEqual(loop.get_hrn(),'')
+ # xxx - this is not quite right as the first object has type None
+ self.assertEqual(loop.get_type(),'')
def test_host001 (self):
def test_login_base_001 (self):
xrn=PlXrn(hrn='ple.inria.omftest',type='slice')
- self.assertEqual(xrn.login_base(),'inria')
+ self.assertEqual(xrn.pl_login_base(),'inria')
def test_slicename_001 (self):
xrn=PlXrn(hrn='ple.inria.omftest',type='slice')
- self.assertEqual(xrn.slicename(),'inria_omftest')
+ self.assertEqual(xrn.pl_slicename(),'inria_omftest')
def test_authname_001 (self):
xrn=PlXrn(hrn='ple.inria.omftest',type='slice')
- self.assertEqual(xrn.authname(),'inria')
+ self.assertEqual(xrn.pl_authname(),'inria')