Beispiel #1
0
 def get_sender(self, stream_type="video"):
     protocol = "http"
     host = get_default_ip()
     if ENABLE_HTTPS:
         protocol = "https"
         host = "mocks.{}".format(DNS_DOMAIN)
     # TODO: Provide the means to downgrade this to a <v1.2 JSON representation
     sender = {
         "id":
         str(uuid.uuid4()),
         "label":
         "Dummy Sender",
         "description":
         "Dummy Sender",
         "version":
         "50:50",
         "caps": {},
         "tags": {},
         "manifest_href":
         "{}://{}:{}/{}.sdp".format(protocol, host, self.port, stream_type),
         "flow_id":
         str(uuid.uuid4()),
         "transport":
         "urn:x-nmos:transport:rtp.mcast",
         "device_id":
         str(uuid.uuid4()),
         "interface_bindings": ["eth0"],
         "subscription": {
             "receiver_id": None,
             "active": True
         }
     }
     return sender
Beispiel #2
0
    def _registry_mdns_info(self, port, priority=0):
        """Get an mDNS ServiceInfo object in order to create an advertisement"""
        # TODO: Add another test which checks support for parsing CSV string in api_ver
        txt = {
            'api_ver': self.apis[NODE_API_KEY]["version"],
            'api_proto': self.protocol,
            'pri': str(priority)
        }

        service_type = "_nmos-registration._tcp.local."
        if self.is04_utils.compare_api_version(
                self.apis[NODE_API_KEY]["version"], "v1.3") >= 0:
            service_type = "_nmos-register._tcp.local."

        info = ServiceInfo(service_type,
                           "NMOSTestSuite{}.{}".format(port, service_type),
                           socket.inet_aton(get_default_ip()), port, 0, 0, txt,
                           "nmos-mocks.local.")
        return info
Beispiel #3
0
 def __init__(self):
     self.default_ip = get_default_ip()
     self.resolver = None
     self.server = None
     self.base_zone_data = None
     self.reset()