+.gitignore
build/*
-*.pyc
\ No newline at end of file
+*.pyc
+TAGS
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):