Commit d0963efd authored by ericbsd's avatar ericbsd
Browse files

added test to wait on dataset permision job with tftp testing

Showing with 12 additions and 5 deletions
+12 -5
......@@ -27,6 +27,7 @@ def test_01_Creating_dataset_tftproot():
def test_02_Setting_permissions_for_TFTP_on_mnt_pool_name_tftproot():
global job_id
payload = {
'acl': [],
'mode': '777',
......@@ -36,9 +37,15 @@ def test_02_Setting_permissions_for_TFTP_on_mnt_pool_name_tftproot():
results = POST(f'/pool/dataset/id/{dataset_url}/permission/', payload)
assert results.status_code == 200, results.text
job_id = results.json()
def test_03_Configuring_TFTP_service():
def test_03_verify_the_job_id_is_successfull():
job_status = wait_on_job(job_id, 180)
assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_04_Configuring_TFTP_service():
payload = {
"directory": f"/mnt/{pool_name}/tftproot",
"username": "nobody",
......@@ -49,13 +56,13 @@ def test_03_Configuring_TFTP_service():
assert isinstance(results.json(), dict), results.text
def test_04_Enable_TFTP_service():
def test_05_Enable_TFTP_service():
results = PUT("/service/id/tftp/", {"enable": True})
assert results.status_code == 200, results.text
def test_05_Start_TFTP_service():
def test_06_Start_TFTP_service():
results = POST(
'/service/start/', {
'service': 'tftp',
......@@ -69,12 +76,12 @@ def test_05_Start_TFTP_service():
sleep(1)
def test_06_Checking_to_see_if_TFTP_service_is_enabled():
def test_07_Checking_to_see_if_TFTP_service_is_enabled():
results = GET("/service/?service=tftp")
assert results.json()[0]["state"] == "RUNNING", results.text
def test_07_delete_tftp_dataset():
def test_08_delete_tftp_dataset():
results = DELETE(f"/pool/dataset/id/{dataset_url}/")
assert results.status_code == 200, results.text
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment