Skip to content

Commit

Permalink
Exit if DNS-SD mode is unicast and permissions are not elevated
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbonney committed Feb 6, 2019
1 parent 31f3b39 commit 0f07828
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nmos-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from wtforms import Form, validators, StringField, SelectField, IntegerField, HiddenField, FormField, FieldList
from Registry import NUM_REGISTRIES, REGISTRIES, REGISTRY_API
from Node import NODE, NODE_API
from Config import CACHE_PATH, SPECIFICATIONS
from Config import CACHE_PATH, SPECIFICATIONS, ENABLE_DNS_SD, DNS_SD_MODE
from datetime import datetime, timedelta

import git
Expand All @@ -27,6 +27,7 @@
import copy
import pickle
import threading
import sys

import IS0401Test
import IS0402Test
Expand Down Expand Up @@ -247,6 +248,10 @@ def index_page():


if __name__ == '__main__':
if ENABLE_DNS_SD and DNS_SD_MODE == "unicast" and os.geteuid() != 0:
print(" * ERROR: In order to test DNS-SD in unicast mode, the test suite must be run with elevated permissions")
sys.exit(1)

print(" * Initialising specification repositories...")

if not os.path.exists(CACHE_PATH):
Expand Down

0 comments on commit 0f07828

Please sign in to comment.