Giter VIP home page Giter VIP logo

nmos-mdns-bridge's Introduction

NMOS MDNS Bridge

A DNS-SD to HTTP bridging service.

Introduction

This API provides a zeroconf/HTTP bridge for NMOS service types. The API will present itself at http://localhost:12352/x-ipstudio/mdnsbridge/v1.0/.

Installation

Requirements

  • Linux (untested on Windows and Mac)
  • Python 2.7
  • Python Pip
  • NMOS Common

Steps

# Install Python setuptools
$ pip install setuptools

# Install the library
$ sudo python setup.py install

Configuration

The mDNS Bridge makes use of a configuration file provided by the NMOS Common Library. Please see that repository for configuration details.

Usage

On systems using systemd for service management (e.g Ubuntu >= 16.04) mdnsbridge may be run as a service. To enable the service create a symbolic link and start the service as follows:

sudo ln -s /lib/systemd/system/mdnsbridge.service /etc/systemd/system/multi-user.target.wants/mdnsbridge.service
sudo systemctl start mdnsbridge

Non-blocking

Alternatively mdnsbridge may be run from a Python script. Run the following script to start the mDNS Brdige in a non-blocking manner, and then stop it again at a later point:

    from mdnsbridge.mdnsbridgeservice import mDNSBridgeService

    service = mDNSBridgeService()
    service.start()

    # Do something else until ready to stop

    service.stop()

Blocking

It is also possible to run mDNS Bridge in a blocking manner:

    from mdnsbridge.mdnsbridgeservice import mDNSBridgeService

    service = mDNSBridgeService()
    service.run() # Runs forever

Development

Testing

# Run the tests
$ make test

Packaging

Packaging files are provided for internal BBC R&D use. These packages depend on packages only available from BBC R&D internal mirrors, and may not work in other environments. For use outside the BBC please use python installation method.

# Debian packaging
$ make deb

# RPM packaging
$ make rpm

Versioning

We use Semantic Versioning for this repository

Changelog

See CHANGELOG.md

Contributing

See CONTRIBUTING.md

Please ensure you have run the test suite before submitting a Pull Request, and include a version bump in line with our Versioning policy.

License

See LICENSE.md

nmos-mdns-bridge's People

Contributors

alexrawcliffe avatar andrewbonney avatar dannymeloy avatar jamesba avatar jamesgibo avatar peterbrightwell avatar simonrankine avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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

nmos-mdns-bridge's Issues

test ordering causes fail

Found that the tests would fail on some occasions with errors such as (the error from tox is not helpful):

======================================================================
ERROR: test_base_resource (tests.test_mdnsbridge.TestmDNSBridgeAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_mdnsbridge.py", line 76, in test_base_resource
    self.assert_method_has_path_and_returns('base_resource', "/{}/{}/{}/".format(APINAMESPACE, APINAME, APIVERSION), {"resources": [value + "/" for value in VALID_TYPES]})
  File "tests/test_mdnsbridge.py", line 52, in assert_method_has_path_and_returns
    self.assertEqual(getattr(self.UUT, method).mock_path, path, msg="method {} was inserted into the webapi with the incorrect path: {}, when expected {}".format(method, getattr(self.UUT, method).mock_path, path))
AttributeError: 'function' object has no attribute 'mock_path'

It turns out that the order in which the tests are executed is important. python -m unittest -v tests.test_mdnsbridge tests.test_mdnsbridgeservice succeeds but python -m unittest -v tests.test_mdnsbridgeservice tests.test_mdnsbridge fails.

This suggests that one test is mocking the other test.

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.