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

[IS-11] Make test cases independent #836

Merged
merged 22 commits into from
Nov 3, 2023

Conversation

N-Nagorny
Copy link
Collaborator

This PR unifies IS-11 test suite with the rest in terms of test cases independence.

The first reworked part is tests of Inputs:

  • test 0.1 -> test_1
  • tests 0.2, 0.3 -> deactivate_connection_resources called in set_up_tests
  • test 1.0 -> delete_active_constraints called in set_up_tests
  • test 1.1 has been removed
  • test 1.2 -> set_up_tests
  • test 1.4.0 -> set_up_tests
  • test 1.4.1 -> test_2
  • tests 1.4.3, 1.4.4 has been removed
  • tests 1.4.2, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10 -> test_3
  • test 1.4.11 -> test_4
  • tests 1.5.0, 1.5.1 have been removed
  • tests 1.5.2, 1.5.3, 1.5.4, 1.5.5 -> test_5
  • tests 1.6.1, 1.7.1 have been removed
  • tests 1.6.2, 1.7.2 -> test_6
  • test 1.8 has been removed
  • test 2.3.2 disabled
  • test 6.5 has been merged with test 6.4

@N-Nagorny
Copy link
Collaborator Author

Tests of Outputs:

  • test 3.1 has been removed
  • test 3.2 -> set_up_tests
  • test 3.3 has been removed
  • test 3.4.0 -> set_up_tests
  • test 3.4.1 has been removed
  • test 3.4.2 -> test_7
  • test 3.5.0 -> set_up_tests
  • test 3.5.1 -> test_8

Copy link

@gwgeorgea gwgeorgea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments

test_data/IS1101/invalid_edid.bin Outdated Show resolved Hide resolved
test_data/IS1101/valid_edid.bin Outdated Show resolved Hide resolved
data=VALID_EDID)
if not valid or response.status_code != 204:
return test.FAIL("Unexpected response from "
"the Stream Compatibility Management API: {}".format(response))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add reasonable delay after put command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code PUTs and then immediately GETs /edid/base. It's clear that handling the new EDID by an external baseband source takes some time but the API is the matter of the Node, and the spec doesn't allow the following situation:

  1. value is ABC
  2. user sets it to CBA
  3. user requests it and gets ABC
  4. user waits some time
  5. user requests it again and gets CBA

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1f83676

valid, response = self.do_request("DELETE", self.compat_url + "inputs/" + inputId + "/edid/base")
if not valid or response.status_code != 204:
return test.FAIL("Unexpected response from "
"the Stream Compatibility Management API: {}".format(response))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add reasonable delay after Delete command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same case as #836 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1f83676

valid, response = self.do_request("PUT",
self.compat_url + "inputs/" + inputId + "/edid/base",
headers={"Content-Type": "application/octet-stream"},
data=VALID_EDID)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add reasonable delay after Put command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version of an Input should increment immediately after a PUT, isn't it?

if not valid or response.status_code != 405:
return test.FAIL("Unexpected response "
"for DELETE /edid/base: {}".format(response))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add reasonable delay after Delete command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect that a Node rejects the request, why should we wait here?

nmostesting/suites/IS1101Test.py Outdated Show resolved Hide resolved
valid, response = self.do_request("GET", self.compat_url + "inputs/" + inputId + "/edid/base")
if not valid or response.status_code != 204:
return test.FAIL("Unexpected response from "
"the Stream Compatibility Management API: {}".format(response))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add reasonable delay after Delete command before getting the effective EDID
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 1f83676

@gwgeorgea
Copy link

Let's merge this PR in is-11

@N-Nagorny N-Nagorny merged commit 57a4d79 into AMWA-TV:is-11 Nov 3, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants