Code Monkey home page Code Monkey logo

opennsa's Introduction

Build Status

OpenNSA

OpenNSA is an implementation of the Network Service Interface (NSI).

NSI (Network Service Interface) is a technology agnostic protocol for provisioning network circuits. For more information on NSI, see project page at OGF: https://redmine.ogf.org/projects/nsi-wg

OpenNSA is currently in a state of heavy development, and many features are only partially implemented.

OpenNSA features

  • Open-source NSI implementation
  • Pluggable backends to support different equipment
    • Support: Junox MX, Force10 switch (etherscale), Dell Powerconnect
    • DUD backend for easy testing
    • Any custom Python backend
  • Easy development of new backends
  • Easy creation of NML topology from short-hand topology specification
  • Topology aggregation and path finding to do multi-domain circuit creation
  • PostgreSQL for database
  • Includes command line tool for basic operations

Documentation

Full and detailed documentation available here

License

NORDUnet License (3-clause BSD). See LICENSE for more details.

Contact

  • Johannes Garm Houen - jgh @ nordu.net
  • Samir Faci - samir @ es.net

Copyright

NORDUnet (2011-2015)

opennsa's People

Contributors

bjpbakker avatar csg33k avatar dependabot[bot] avatar hanstrompert avatar htj avatar igable avatar janvanoorschot avatar jeroenh avatar johannesgarm avatar marcosfsch avatar mkrogh avatar safaci2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opennsa's Issues

Add support for SOAPFaults.

Look like onsa command line has issues handling SOAP faults returned from service providers. The following error was generated when a SOAP fault was received for invalid message contents.

opennsa@nsi0:~$ onsa reserveprovision -s calit2.optiputer.net:2020:prism-core:k8s-gen4-01#vlan=1779 -d calit2.optiputer.net:2020:prism-core:k8s-gen4-02#vlan=1779 -y
Site (TLS) starting on 7080
Starting factory <twisted.web.server.Site object at 0x7ffad832c6a0>
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 501, in errback
    self._startRunCallbacks(fail)
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
    _inlineCallbacks(r, g, status)
--- <exception caught here> ---
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python3.7/dist-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/bin/onsa", line 196, in doMain
    yield commands.reserveprovision(client, nsi_header, source_stp, dest_stp, start_time, end_time, bandwidth, ero, connection_id, global_id, notification_wait)
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/local/lib/python3.7/dist-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/local/lib/python3.7/dist-packages/opennsa/cli/commands.py", line 147, in reserveprovision
    connection_id, _,_, criteria = yield client.reserve(nsi_header, connection_id, global_id, 'Test Connection', crt)
  File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/local/lib/python3.7/dist-packages/opennsa/protocols/nsi2/requesterclient.py", line 135, in _handleAck
    header, ack = helper.parseRequest(soap_data)
  File "/usr/local/lib/python3.7/dist-packages/opennsa/protocols/nsi2/helper.py", line 154, in parseRequest
    body = nsiconnection.parseElement(bodies[0])
  File "/usr/local/lib/python3.7/dist-packages/opennsa/protocols/nsi2/bindings/nsiconnection.py", line 962, in parseElement
    raise ValueError('No type mapping for tag %s' % element.tag)
builtins.ValueError: No type mapping for tag {http://schemas.xmlsoap.org/soap/envelope/}Fault

(TLS Port 7080 Closed)
Stopping factory <twisted.web.server.Site object at 0x7ffad832c6a0>
opennsa@nsi0:~$ 

Here is the SOAP Fault generated by the Safnari NSI provider:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
        <nsi_headers:nsiHeader xmlns:gnsbod="http://nordu.net/namespaces/2013/12/gnsbod" xmlns:nsi_ctypes="http://schemas.ogf.org/nsi/2013/12/connection/types"
            xmlns:nsi_ftypes="http://schemas.ogf.org/nsi/2013/12/framework/types" xmlns:nsi_headers="http://schemas.ogf.org/nsi/2013/12/framework/headers"
            xmlns:nsi_p2p="http://schemas.ogf.org/nsi/2013/12/services/point2point" xmlns:nsi_stypes="http://schemas.ogf.org/nsi/2013/12/services/types"
            xmlns:path_trace="http://schemas.ogf.org/nsi/2015/04/connection/pathtrace" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
            <protocolVersion>application/vnd.ogf.nsi.cs.v2.provider+soap</protocolVersion>
            <correlationId>urn:uuid:e91395de-2143-11ec-aafc-ce184112601b</correlationId>
            <requesterNSA>urn:ogf:network:calit2.optiputer.net:2020:onsa-cli</requesterNSA>
            <providerNSA>urn:ogf:network:es.net:2013:nsa:nsi-aggr-west</providerNSA>
        </nsi_headers:nsiHeader>
    </soapenv:Header>
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server</faultcode>
            <faultstring>Parameter provided contains an unsupported value that MUST be processed</faultstring>
            <detail>
                <nsi_ctypes:serviceException xmlns:gnsbod="http://nordu.net/namespaces/2013/12/gnsbod" xmlns:nsi_ctypes="http://schemas.ogf.org/nsi/2013/12/connection/types"
                    xmlns:nsi_ftypes="http://schemas.ogf.org/nsi/2013/12/framework/types" xmlns:nsi_headers="http://schemas.ogf.org/nsi/2013/12/framework/headers"
                    xmlns:nsi_p2p="http://schemas.ogf.org/nsi/2013/12/services/point2point" xmlns:nsi_stypes="http://schemas.ogf.org/nsi/2013/12/services/types"
                    xmlns:path_trace="http://schemas.ogf.org/nsi/2015/04/connection/pathtrace" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
                    <nsaId>urn:ogf:network:es.net:2013:nsa:nsi-aggr-west</nsaId>
                    <errorId>00102</errorId>
                    <text>Parameter provided contains an unsupported value that MUST be processed</text>
                    <variables>
                        <variable namespace="http://schemas.ogf.org/nsi/2013/12/framework/headers" type="providerNSA">
                            <value>urn:ogf:network:calit2.optiputer.net:2020:nsa</value>
                        </variable>
                    </variables>
                </nsi_ctypes:serviceException>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

Access control not enforced on terminate action.

This one is pretty simple. The query operation filters reservations based on the requester's nsaId so an NSA only sees reservation created by itself, however, OpenNSA does not restrict the terminate operation on NSA to terminate a second NSA's reservation.

originatingConnectionId incorrect in reserveTimeout message.

When the reservation reserveTimeout event is return by an aggregator OpenNSA on PacificWave I get the following content:

reserveTimeout {
    providerNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
    correlationId = urn:uuid:3846121e-fe6b-11ea-af4e-525400c57fcf,
    connectionId = LS-cd202541ea,
    notificationId = 46,
    timeStamp = 2020-09-24T13:38:24.723135Z,
    originatingNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
    originatingConnectionId = JUNOS-711498,
    timeoutValue = 120
}

In this case the “originatingConnectionId” should be set to “LS-cd202541ea” since this NSA is the originating NSA of the timeout. If the aggregator had exposed the underlying uPA then the “originatingNSA” field would have been set to that uPA, and then “originatingConnectionId” as the connectionId in the context of the uPA. However, since there is no visibility of an NSA other than “urn:ogf:network:lsanca.pacificwave.net:2016:nsa” we need it set to “LS-cd202541ea” since this is the uPA reservation in the context of NSI.

Running opennsa on debian 12 fails due to error on twistar library: re.error global flags not at the start

Hi,

After fixing other building errors like the one reported in #44, the following error happens after starting opennsa in Debian 12 I get the following error:

2024-05-08 20:57:30Z [-] Unhandled error in Deferred:
2024-05-08 20:57:30Z [-] Unhandled Error
	Traceback (most recent call last):
	  File "/usr/local/lib/python3.11/dist-packages/twisted/internet/defer.py", line 662, in _runCallbacks
	    current.result = callback(current.result, *args, **kw)
	  File "/usr/local/lib/python3.11/dist-packages/twisted/internet/base.py", line 515, in _continueFiring
	    callable(*args, **kwargs)
	  File "/usr/local/lib/python3.11/dist-packages/twisted/internet/defer.py", line 1656, in unwindGenerator
	    return _cancellableInlineCallbacks(gen)
	  File "/usr/local/lib/python3.11/dist-packages/twisted/internet/defer.py", line 1571, in _cancellableInlineCallbacks
	    _inlineCallbacks(None, g, status)
	--- <exception caught here> ---
	  File "/usr/local/lib/python3.11/dist-packages/twisted/internet/defer.py", line 1445, in _inlineCallbacks
	    result = current_context.run(g.send, result)
	  File "/home/opennsa/opennsa/opennsa/backends/common/genericbackend.py", line 89, in buildSchedule
	    conns = yield GenericBackendConnections.find(where=['source_network = ? AND dest_network = ? AND lifecycle_state <> ?', self.network, self.network, state.TERMINATED])
	  File "/usr/local/lib/python3.11/dist-packages/twistar/dbobject.py", line 427, in find
	    d = config.select(klass.tablename(), id, where, group, limit, orderby)
	  File "/usr/local/lib/python3.11/dist-packages/twistar/dbobject.py", line 364, in tablename
	    klass.TABLENAME = inf.tableize(klass.__name__)
	  File "/usr/local/lib/python3.11/dist-packages/BermiInflector/Inflector.py", line 78, in tableize
	    return self.Inflector.tableize(class_name)
	  File "/usr/local/lib/python3.11/dist-packages/BermiInflector/Rules/Base.py", line 80, in tableize
	    return self.pluralize(self.underscore(class_name))
	  File "/usr/local/lib/python3.11/dist-packages/BermiInflector/Rules/English.py", line 66, in pluralize
	    match = re.search(rules[rule][0], word, re.IGNORECASE)
	  File "/usr/lib/python3.11/re/__init__.py", line 176, in search
	    return _compile(pattern, flags).search(string)
	  File "/usr/lib/python3.11/re/__init__.py", line 294, in _compile
	    p = _compiler.compile(pattern, flags)
	  File "/usr/lib/python3.11/re/_compiler.py", line 743, in compile
	    p = _parser.parse(p, flags)
	  File "/usr/lib/python3.11/re/_parser.py", line 980, in parse
	    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
	  File "/usr/lib/python3.11/re/_parser.py", line 455, in _parse_sub
	    itemsappend(_parse(source, state, verbose, nested + 1,
	  File "/usr/lib/python3.11/re/_parser.py", line 841, in _parse
	    raise source.error('global flags not at the start '
	re.error: global flags not at the start of the expression at position 1

Incorrect modelling of ReserveTimeout in the reservationState machine.

This issue relates to state transitions in the reservationState machine. Using the following reserveTimeout message for illustration:

2020-09-24 06:38:24,764 [ConnectionService] reserveTimeout for {
    providerNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
    correlationId = urn:uuid:3846121e-fe6b-11ea-af4e-525400c57fcf,
    connectionId = LS-cd202541ea,
    notificationId = 46,
    timeStamp = 2020-09-24T13:38:24.723135Z,
    originatingNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
    originatingConnectionId = JUNOS-711498,
    timeoutValue = 120
}

I received this timeout message for reservation”LS-cd202541ea“ and transition my internal reservationState machine to “ReserveTimeout” which is a stable state in the machine. However, the next time I queried this reservation I got the following:

2020-09-24 06:39:05,970 [QuerySummary] incoming providerNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa, QuerySummaryResultType:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:QuerySummaryResultType xmlns:ns6="http://schemas.ogf.org/nsi/2013/12/framework/types" xmlns:ns5="http://www.w3.org/2000/09/xmldsig#" xmlns:ns8="http://schemas.ogf.org/nsi/2013/12/framework/headers" xmlns:ns7="http://schemas.ogf.org/nsi/2013/12/services/point2point" xmlns:ns2="http://schemas.ogf.org/nsi/2013/12/connection/types" xmlns:ns4="http://www.w3.org/2001/04/xmlenc#" xmlns:ns3="urn:oasis:names:tc:SAML:2.0:assertion">
    <connectionId>LS-cd202541ea</connectionId>
    <globalReservationId>urn:ogf:network:lsanca.pacificwave.net:2016:pw-losa2-1:switch:EVTS.A-GOLE:conn+66c1950a-4bcf-464c-ad8c-559cc20a0edb:resource+links-connection_1:vlan+3601</globalReservationId>
    <description>deltaId+c7544ad5-7d9f-49f2-90e2-9baddecddbe6:uuid+950bc160-7fa3-4fba-8be1-daf8f9e71ff5</description>
    <criteria version="0">
        <schedule>
            <endTime>2021-09-24T13:36:24.224000Z</endTime>
        </schedule>
        <serviceType>http://services.ogf.org/nsi/2013/07/descriptions/EVTS.A-GOLE</serviceType>
        <children/>
        <ns7:p2ps>
            <capacity>10000</capacity>
            <directionality>Bidirectional</directionality>
            <symmetricPath>false</symmetricPath>
            <sourceSTP>urn:ogf:network:lsanca.pacificwave.net:2016:pw-losa2-1:snvl2-pw-sw-1?vlan=3601</sourceSTP>
            <destSTP>urn:ogf:network:lsanca.pacificwave.net:2016:pw-losa2-1:ultralight?vlan=3601</destSTP>
        </ns7:p2ps>
    </criteria>
    <requesterNSA>urn:ogf:network:lsanca.pacificwave.net:2016:sense:pw-losa2-1</requesterNSA>
    <connectionStates>
        <reservationState>ReserveHeld</reservationState>
        <provisionState>Released</provisionState>
        <lifecycleState>Created</lifecycleState>
        <dataPlaneStatus>
            <active>false</active>
            <version>0</version>
            <versionConsistent>false</versionConsistent>
        </dataPlaneStatus>
    </connectionStates>
    <notificationId>1089211</notificationId>
    <resultId>0</resultId>
</ns2:QuerySummaryResultType>

It seems that even though the reservation timed out it remains in the “ReserveHeld” state. This presents a problem in that it is not a valid transition (ie. it should be in the ReserveTimeout state), and I still see my reservation in a ReserveHeld state but cannot commit it.

In the NSI CS 2.1 protocol the aggregator also models the reserve timeout state two provide a consistent view of the reservation throughout the connection hierarchy.

Implement policy to allow admin access to querySummary of all reservations.

The NSI CS 2.1 standard specifies in the querySummary text: "If no criteria are specified then all reservations stored in the PA are returned. The PA may restrict visibility to reservations based on local access control policies."

At the moment OpenNSA restricts visibility based on requesting NSA identifier (a valid policy). This causes administration issues when trying to determine all the reservations currently in the OpenNSA database through the NSI protocol (I am aware the rest API provides this capability). Also, SENSE utilizes this query functionality to build a topology based on utilization so reservations never attempt to reserve bandwidth already reserved.

Suggest a mechanism similar to the allowedhosts configuration item in opennsa.conf where a list of requester nsaId can be designated as administration level access, and therefore, are assigned a policy allowing them to see all reservations in the querySummary operation. This should also be extended to the terminate operation to allow for admin level removal of reservations.

9.4.12.1 Request: querySummary
The querySummary message provides a mechanism for an RA to query the PA for a set of connection service reservation instances. This message can be used to monitor the progress of a reservation.

Elements compose a filter for specifying the reservations to return in response to the querySummary request. Querying of reservations can be performed based on connectionId or globalReservationId. Filter items specified are OR'ed to build the match criteria. If no criteria are specified then all reservations stored in the PA are returned. The PA may restrict visibility to reservations based on local access control policies.

Error Loading CA certificate

Running the OpenNSA (master) docker with TLS, I always get a fatal error on twisted.

opennsa_1 | 2021-08-10 21:20:14Z [-] Loading opennsa.tac...
opennsa_1 | 2021-08-10 21:20:14Z [-] Loaded.
opennsa_1 | 2021-08-10 21:20:14Z [-] twistd 21.7.0 (/usr/bin/python3 3.7.3) starting up.
opennsa_1 | 2021-08-10 21:20:14Z [-] reactor class: twisted.internet.epollreactor.EPollReactor.
opennsa_1 | 2021-08-10 21:20:14Z [-] OpenNSA service initializing
opennsa_1 | 2021-08-10 21:20:14Z [opennsaTlsContext] Loaded CA certificate commonName b'OISTE WISeKey Global Root GB CA'
opennsa_1 | 2021-08-10 21:20:14Z [opennsaTlsContext] Loaded CA certificate commonName b'Baltimore CyberTrust Root'
opennsa_1 | 2021-08-10 21:20:14Z [opennsaTlsContext] Loaded CA certificate commonName b'Certum Trusted Network CA 2'
opennsa_1 | 2021-08-10 21:20:14Z [-] Traceback (most recent call last):
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/internet/_sslverify.py", line 324, in getattr
opennsa_1 | 2021-08-10 21:20:14Z [-] return self[_x509names[attr]]
opennsa_1 | 2021-08-10 21:20:14Z [-] KeyError: 'commonName'
opennsa_1 | 2021-08-10 21:20:14Z [-]
opennsa_1 | 2021-08-10 21:20:14Z [-] During handling of the above exception, another exception occurred:
opennsa_1 | 2021-08-10 21:20:14Z [-]
opennsa_1 | 2021-08-10 21:20:14Z [-] Traceback (most recent call last):
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/bin/twistd", line 10, in
opennsa_1 | 2021-08-10 21:20:14Z [-] sys.exit(run())
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/twistd.py", line 36, in run
opennsa_1 | 2021-08-10 21:20:14Z [-] app.run(runApp, ServerOptions)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/app.py", line 676, in run
opennsa_1 | 2021-08-10 21:20:14Z [-] runApp(config)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/twistd.py", line 30, in runApp
opennsa_1 | 2021-08-10 21:20:14Z [-] runner.run()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/app.py", line 376, in run
opennsa_1 | 2021-08-10 21:20:14Z [-] self.postApplication()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/_twistd_unix.py", line 255, in postApplication
opennsa_1 | 2021-08-10 21:20:14Z [-] self.startApplication(self.application)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/_twistd_unix.py", line 456, in startApplication
opennsa_1 | 2021-08-10 21:20:14Z [-] app.startApplication(application, not self.config["no_save"])
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/app.py", line 691, in startApplication
opennsa_1 | 2021-08-10 21:20:14Z [-] service.IService(application).startService()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/service.py", line 276, in startService
opennsa_1 | 2021-08-10 21:20:14Z [-] service.startService()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/setup.py", line 331, in startService
opennsa_1 | 2021-08-10 21:20:14Z [-] factory, ctx_factory = self.setupServiceFactory()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/setup.py", line 184, in setupServiceFactory
opennsa_1 | 2021-08-10 21:20:14Z [-] ctx_factory = setupTLSContext(vc) # May be None
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/setup.py", line 107, in setupTLSContext
opennsa_1 | 2021-08-10 21:20:14Z [-] ctx_factory = opennsa2WayTlsContext(vc[config.KEY], vc[config.CERTIFICATE], vc[config.CERTIFICATE_DIR], vc[config.VERIFY_CERT])
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/opennsaTlsContext.py", line 116, in init
opennsa_1 | 2021-08-10 21:20:14Z [-] opennsaTlsContext.init(self, certificate_dir, verify)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/opennsaTlsContext.py", line 30, in init
opennsa_1 | 2021-08-10 21:20:14Z [-] self._trustRoot = self._createTrustRootFromCADirectory(certificate_dir)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/opennsaTlsContext.py", line 49, in _createTrustRootFromCADirectory
opennsa_1 | 2021-08-10 21:20:14Z [-] log.msg('Loaded CA certificate commonName %s' % (str(CACertificates[-1].getSubject().commonName)), system = LOG_SYSTEM)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/internet/_sslverify.py", line 326, in getattr
opennsa_1 | 2021-08-10 21:20:14Z [-] raise AttributeError(attr)
opennsa_1 | 2021-08-10 21:20:14Z [-] AttributeError: commonName

Invalid topology document is being generated

At the moment OpenNSA is generating topology documents with the nsidef:serviceDefinition element placed between the <nml:Relation type="http://schemas.ogf.org/nml/2013/05/base#hasOutboundPort"> relation and the <nml:Relation type="http://schemas.ogf.org/nml/2013/05/base#hasService"> relation elements. This is incorrect. The nsidef:serviceDefinition element must be placed after the last nml:BidirectionalPort element and before the <nml:Relation type="http://schemas.ogf.org/nml/2013/05/base#hasInboundPort"> element.

serviceException element contains invalid variables element.

OpenNSA will return a serviceException element with a variable formatted as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:ftypes="http://schemas.ogf.org/nsi/2013/12/framework/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header />
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>Invalid request: Start time in the past (Startime: 2016-11-03 14:15:00, Delta: 5:49:52.841370)</faultstring>
            <detail>
                <ftypes:serviceException>
                    <nsaId>urn:ogf:network:icair.org:2013:nsa</nsaId>
                    <errorId>00100</errorId>
                    <text>Invalid request: Start time in the past (Startime: 2016-11-03 14:15:00, Delta: 5:49:52.841370)</text>
                    <variables>
                        <variables type="startTime">
                            <value>2016-11-03T14:15:00</value>
                        </variables>
                    </variables>
                </ftypes:serviceException>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

The <variables> element should contain a <variable> element and not another <variables> element as follows:

                    <variables>
                        <variable type="startTime">
                            <value>2016-11-03T14:15:00</value>
                        </variable>
                    </variables>

The issue is locaed in: opennsa/protocols/nsi2/bindings/nsiframework.py

@@ -175,7 +175,7 @@ class ServiceExceptionType(object):
        ET.SubElement(r, 'errorId').text = self.errorId
        ET.SubElement(r, 'text').text = self.text
        if self.variables is not None:
-          ET.SubElement(r, 'variables').extend( [ e.xml('variables') for e in self.variables ] )
+          ET.SubElement(r, 'variables').extend( [ e.xml('variable') for e in self.variables ] )
        if self.childException is not None:
            for el in self.childException:
                ET.SubElement(r, 'childException').extend( el.xml('childException') )

Current onsa tool has broken import

onsa:111 contains

    if topology_file and network:
        from opennsa.topology import gole

This file does not exist, so this breaks this invocation method of the tool.

[BUG] Fix Broken Unit Tests

The following tests are failing:

testDoubleReserve ...                                               [ERROR]
testHairpinConnection ...                                           [ERROR]
testIdenticalPortSTPs ...                                           [ERROR]
testInvalidNetworkReservation ...                                   [ERROR]
testInvalidRewrite ...                                              [ERROR]
testProvisionNonExistentConnection ...                              [ERROR]
testProvisionPostTerminate ...                                      [ERROR]
testProvisionWithoutCommit ...                                      [ERROR]
testReserveFailAndLabelSwapEnabled ...                              [ERROR]
testStartTimeInPast ...                                             [ERROR]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.