Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soften the policy of deactivating IS-05 Senders/Receivers #805

Open
wants to merge 3 commits into
base: is-11
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions nmostesting/suites/IS1101Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,24 @@ def test_00_01(self, test):

def test_00_02(self, test):
"Put all senders into inactive state"

warning_senders = []

valid, response = TestHelper.do_request("GET", self.compat_url + "senders/")
if not valid:
return test.FAIL(response)
if response.status_code != 200:
return test.FAIL("The request has not succeeded: {}".format(response.json()))
is11_senders = response.json()

senders_url = self.conn_url + "single/senders/"
_, response = TestHelper.do_request("GET", senders_url)
valid, response = TestHelper.do_request("GET", senders_url)
if not valid:
return test.FAIL(response)
if response.status_code != 200:
return test.FAIL("The request has not succeeded: {}".format(response.json()))
senders = response.json()

if len(senders) > 0:
for sender in senders:
url = senders_url + sender + "staged/"
Expand All @@ -132,17 +145,36 @@ def test_00_02(self, test):
or response.json()["master_enable"]
or response.json()["activation"]["mode"] != "activate_immediate"
):
return test.FAIL("The request has not succeeded: {}".format(response.json()))
if sender in is11_senders:
return test.FAIL("The request has not succeeded: {}".format(response.json()))
else:
warning_senders.append(sender[:-1])
if warning_senders:
return test.WARNING("IS-05 Senders {} returned codes other than 200 while being deactivated"
.format(", ".join(warning_senders)))
return test.PASS()
return test.UNCLEAR("Could not find any senders to test")

def test_00_03(self, test):
"Put all the receivers into inactive state"

warning_receivers = []

valid, response = TestHelper.do_request("GET", self.compat_url + "receivers/")
if not valid:
return test.FAIL(response)
if response.status_code != 200:
return test.FAIL("The request has not succeeded: {}".format(response.json()))
is11_receivers = response.json()

receivers_url = self.conn_url + "single/receivers/"
_, response = TestHelper.do_request("GET", receivers_url)
valid, response = TestHelper.do_request("GET", receivers_url)
if not valid:
return test.FAIL(response)
if response.status_code != 200:
return test.FAIL("The request has not succeeded: {}".format(response.json()))
receivers = response.json()

if len(receivers) > 0:
for receiver in receivers:
url = receivers_url + receiver + "staged/"
Expand All @@ -156,8 +188,13 @@ def test_00_03(self, test):
or response.json()["master_enable"]
or response.json()["activation"]["mode"] != "activate_immediate"
):
return test.FAIL("The request has not succeeded: {}".format(response.json()))

if receiver in is11_receivers:
return test.FAIL("The request has not succeeded: {}".format(response.json()))
else:
warning_receivers.append(receiver[:-1])
if warning_receivers:
return test.WARNING("IS-05 Receivers {} returned codes other than 200 while being deactivated"
.format(", ".join(warning_receivers)))
return test.PASS()

return test.UNCLEAR("Could not find any receivers to test")
Expand Down