def test_02_reboot_and_wait_for_ping(): payload = {"delay": 0} results = POST("/system/reboot/", payload) assert results.status_code == 200, results.text while ping_host(ip, 1) is True: sleep(5) while ping_host(ip, 1) is not True: sleep(5) sleep(10)
def test_13_wait_for_FreeNAS_to_be_online(request): depends(request, ["update_03", "update_06", "update_09", "update_10"]) if reboot is False: pytest.skip('Reboot is False skip') else: while ping_host(ip, 1) is not True: sleep(5) assert ping_host(ip, 1) is True sleep(10)
def test_10_wait_for_reboot(): if vm_name is not None: while vm_state(vm_name) != 'stopped': sleep(5) assert vm_start(vm_name) is True sleep(1) while ping_host(ip) is not True: sleep(5) assert ping_host(ip) is True sleep(10)
def test_19_start_vm_bhyve_and_wait_for_freenas_to_be_online(): if vm_name is not None and interface == 'vtnet0': assert vm_start(vm_name) is True sleep(1) while ping_host(ip) is not True: sleep(5) assert ping_host(ip) is True sleep(10) else: pytest.skip('skip no vm_name')
def test_20_start_vm_bhyve_and_wait_for_freenas_to_be_online(): if vm_name is not None and interface == 'vtnet0': assert vm_start(vm_name) is True sleep(1) while ping_host(ip) is not True: sleep(5) assert ping_host(ip) is True sleep(15) else: pytest.skip('skip no vm_name')
def test_13_wait_for_FreeNAS_to_be_online(): if update_version is None: pytest.skip('No update found') elif download_hang is True: pytest.skip(f'Downloading {selected_trains} failed') else: while ping_host(ip) is not True: sleep(5) assert ping_host(ip) is True sleep(10)
def test_13_wait_for_FreeNAS_to_be_online(): if update_version is None: pytest.skip('No update found') elif download_failed is True: pytest.skip(f'Downloading {selected_trains} failed') elif reboot is False: pytest.skip(f'Reboot is False skip') else: while ping_host(ip) is not True: sleep(5) assert ping_host(ip) is True sleep(10)
def test_06_wait_for_middleware_to_be_online(): while ping_host(ip, 1) is True: sleep(5) while ping_host(ip, 1) is not True: sleep(5) sleep(10) status_code = 0 while status_code != 200: try: status_code = GET('/system/info/').status_code except requests.exceptions.ConnectionError: sleep(1) continue
from auto_config import ip, pool_name from config import * if "BRIDGEHOST" in locals(): MOUNTPOINT = "/tmp/ad-osx" + BRIDGEHOST DATASET = "ad-osx" SMB_NAME = "TestShare" SMB_PATH = f"/mnt/{pool_name}/{DATASET}" VOL_GROUP = "wheel" OSXReason = 'OSX host configuration is missing in ixautomation.conf' Reason = "AD_DOMAIN, ADPASSWORD, and ADUSERNAME are missing in config.py" ad_host_up = False if 'AD_DOMAIN' in locals(): ad_host_up = ping_host(AD_DOMAIN, 5) if ad_host_up is False: Reason = f'{AD_DOMAIN} is down' ad_test_cfg = pytest.mark.skipif(all([ "AD_DOMAIN" in locals(), "ADPASSWORD" in locals(), "ADUSERNAME" in locals(), ad_host_up is True ]) is False, reason=Reason) osx_host_cfg = pytest.mark.skipif(all([ "OSX_HOST" in locals(), "OSX_USERNAME" in locals(), "OSX_PASSWORD" in locals() ]) is False, reason=OSXReason)
def test_10_wait_for_ping_to_be_down(): while ping_host(ip, 1) is not False: sleep(5) assert ping_host(ip, 1) is False
def test_11_wait_for_ping_to_be_up(): while ping_host(ip, 1) is not True: sleep(5) assert ping_host(ip, 1) is True sleep(15)
def test_10_wait_for_ping_to_be_down(): while ping_host(ip) is not False: sleep(5) assert ping_host(ip) is False
def test_11_wait_for_ping_to_be_up(): while ping_host(ip) is not True: sleep(5) assert ping_host(ip) is True sleep(15)