def test_22_set_externalInterfaces(request): depends(request, ['tc_chart_release']) global gateway gateway = GET('/network/general/summary/').json()['default_routes'][0] payload = { 'values': { 'externalInterfaces': [ { 'hostInterface': f'{interface}', 'ipam': { 'type': 'static', 'staticIPConfigurations': [f'{ip}/24'], 'staticRoutes': [ { 'destination': '0.0.0.0/0', 'gateway': gateway } ] } } ] } } results = PUT(f'/chart/release/id/{tc_release_id}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), int), results.text job_status = wait_on_job(results.json(), 300) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_28_change_truecommand_ix_chart_updatestrategy_to_recreate(request): depends(request, ['tc_chart_release']) payload = {'values': {'updateStrategy': 'Recreate'}} results = PUT(f'/chart/release/id/{tc_release_id}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), int), results.text job_status = wait_on_job(results.json(), 300) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_02_change_enable_image_updates_to_false(): payload = { 'enable_image_updates': False } results = PUT('/container/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict), results.text assert results.json()['enable_image_updates'] is False, results.text
def test_08_set_main_interface_ipv4_to_false(): payload = { 'ipv4_dhcp': False, "aliases": [{ 'address': ip, 'netmask': aliases['netmask'] }] } results = PUT(f'/interface/id/{interface}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text assert results.json()['ipv4_dhcp'] is False, results.text
def test_08_set_main_interface_ipv4_to_false(): payload = { 'ipv4_dhcp': False, "aliases": [ { 'address': ip, 'netmask': aliases['netmask'] } ] } results = PUT(f'/interface/id/{interface}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text assert results.json()['ipv4_dhcp'] is False, results.text
def test_08_set_main_interface_ipv4_to_false(): payload = { 'ipv4_dhcp': False, "aliases": [{ 'address': ip, 'netmask': aliases['netmask'] }] } if any([ha, scale]) is False: payload['disable_offload_capabilities'] = True results = PUT(f'/interface/id/{interface}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text assert results.json()['ipv4_dhcp'] is False, results.text
def test_08_system_advanced_set_motd(): results = PUT('/system/advanced/', { 'motd': MOTD }) assert results.status_code == 200, results.text data = results.json() assert isinstance(data, dict), data
def test_37_set_truecommand_ix_chart_volumes(request): depends(request, ['tc_chart_release']) global payload payload = { 'values': { 'volumes': [{ 'mountPath': '/mnt', 'datasetName': 'tc-mountpath' }] } } results = PUT(f'/chart/release/id/{tc_release_id}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), int), results.text job_status = wait_on_job(results.json(), 300) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_15_set_interface_for_ha(): payload = { 'ipv4_dhcp': False, 'failover_critical': True, 'failover_vhid': vhid, 'failover_group': 1, "aliases": [{ 'type': 'INET', 'address': controller1_ip, 'netmask': 23 }], 'failover_aliases': [{ 'type': 'INET', 'address': controller2_ip, }], 'failover_virtual_aliases': [{ 'type': 'INET', 'address': virtual_ip, }], } results = PUT(f'/interface/id/{interface}/', payload, controller_a=ha) assert results.status_code == 200, results.text global interfaces_id interfaces_id = results.json()['id']
def test_63_re_enable_activedirectory(request): depends(request, ["pool_04", "ad_01", "ad_02", "ad_10"], scope="session") global payload, results, job_id payload = {"enable": True} results = PUT("/activedirectory/", payload) assert results.status_code == 200, results.text job_id = results.json()['job_id']
def test_26_set_truecommand_ix_chart_portforwarding(request): depends(request, ['tc_chart_release']) payload = { 'values': { 'portForwardingList': [{ 'containerPort': 80, 'nodePort': 20345, 'protocol': 'TCP' }] } } results = PUT(f'/chart/release/id/{tc_release_id}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), int), results.text job_status = wait_on_job(results.json(), 300) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_06_system_advanced_disable_serial_port(): results = PUT('/system/advanced/', { 'serialconsole': False, }) assert results.status_code == 200, results.text data = results.json() assert isinstance(data, dict), data
def test_15_change_truechart_preferred_trains(): payload = { 'preferred_trains': ['test'] } results = PUT('/catalog/id/TRUECHARTS/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict), results.text
def test_01_enable_and_verify_service(svc): results = PUT(f'/service/id/{all_services[svc]["id"]}/', {'enable': True}) assert results.status_code == 200, results.text results = GET(f'/service/id/{all_services[svc]["id"]}/') assert results.status_code == 200, results.text assert results.json()['enable'], results.text
def test_21_change_some_ipfs_schema_values(request): depends(request, ['release_ipfs', 'hostPath_dataset']) global payload payload = { 'values': { 'updateStrategy': 'RollingUpdate', 'service': { 'swarmPort': 10401, 'apiPort': 10501, 'gatewayPort': 10880 }, 'appVolumeMounts': { 'staging': { 'datasetName': 'ix-ipfs-staging', 'mountPath': '/export', 'hostPathEnabled': True, 'hostPath': f'/mnt/{pool_name}/ipfs-staging' }, 'data': { 'datasetName': 'ix-ipfs-data', 'mountPath': '/data/ipfs', 'hostPathEnabled': True, 'hostPath': f'/mnt/{pool_name}/ipfs-data' } } } } results = PUT(f'/chart/release/id/{release_id}/', payload) assert results.status_code == 200, results.text job_status = wait_on_job(results.json(), 300) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_09_update_jail_description(): global JAIL_NAME results = PUT(f'/jail/id/{JAIL_NAME}/', {'name': JAIL_NAME + '_renamed'}) assert results.status_code == 200, results.text assert results.json() is True, results.text JAIL_NAME += '_renamed'
def test_32_set_truecommand_ix_chart_livenessProbe(request): depends(request, ['tc_chart_release']) payload = { 'values': { 'livenessProbe': { 'command': ['ls /usr/share'], 'initialDelaySeconds': 10, 'periodSeconds': 15 } } } results = PUT(f'/chart/release/id/{tc_release_id}/', payload) assert results.status_code == 200, results.text assert isinstance(results.json(), int), results.text job_status = wait_on_job(results.json(), 300) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_04_disable_tuneable(): results = PUT( f'/tunable/id/{TUNABLE_ID}', { 'enabled': False } ) assert results.json()['enabled'] is False, results.text
def test_56_re_enable_activedirectory(request): depends(request, ["ad_dataset_permission"], scope="session") global payload, results payload = {"enable": True} results = PUT("/activedirectory/", payload) assert results.status_code == 200, results.text job_status = wait_on_job(results.json()['job_id'], 180) assert job_status['state'] == 'SUCCESS', str(job_status['results'])
def test_13_change_tunable_comment(): global payload, results payload = { "tun_comment": "New tunable dummynet tests", } results = PUT(f"/system/tunable/{tunable_id}/", payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text
def test_079_change_timemachine_to_true(): global vuid payload = { 'timemachine': True, } results = PUT(f"/sharing/smb/id/{smb_id}/", payload) assert results.status_code == 200, results.text vuid = results.json()['vuid']
def test_084_change_recyclebin_to_true(): global vuid payload = { "recyclebin": True, } results = PUT(f"/sharing/smb/id/{smb_id}", payload) assert results.status_code == 200, results.text vuid = results.json()['vuid']
def test_02_disable_and_verify_service(svc, request): depends(request, ['ENABLE']) results = PUT(f'/service/id/{all_services[svc]["id"]}/', {'enable': False}) assert results.status_code == 200, results.text results = GET(f'/service/id/{all_services[svc]["id"]}/') assert results.status_code == 200, results.text assert not results.json()['enable'], results.text
def test_12_change_tunable_comment(): global payload, results payload = { "tun_comment": "New tunable dummynet tests", } results = PUT(f"/system/tunable/{tunable_id}/", payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text
def test_02_set_nameserver_for_ad(request): depends(request, ["pool_04"], scope="session") global payload payload = {"nameserver1": '8.8.8.8', "nameserver2": '8.8.4.4'} global results results = PUT("/network/configuration/", payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict), results.text
def test_03_system_advanced_set_serial_port(sysadv_dict): results = PUT('/system/advanced/', { 'serialconsole': True, 'serialport': sysadv_dict['serial_choices'][0], }) assert results.status_code == 200, results.text data = results.json() assert isinstance(data, dict), data
def test_11_update_jail_description(): if freeze is True: pytest.skip(freeze_msg) global JAIL_NAME results = PUT(f'/jail/id/{JAIL_NAME}/', {'name': JAIL_NAME + '_renamed'}) assert results.status_code == 200, results.text assert results.json() is True, results.text JAIL_NAME += '_renamed'
def test_08_update_jail_description(): global JAIL_NAME result = PUT(f'/jail/id/{JAIL_NAME}', {'name': JAIL_NAME + '_renamed'}) assert result.json() is True, result.text JAIL_NAME += '_renamed'
def test_07_update_disk_description(): updated_description = 'Updated description' results = PUT( f'/disk/id/{DISK_ID}/', { 'description': updated_description } ) assert results.status_code == 200, results.text assert results.json()['description'] == updated_description, results.text
def test_03_Configuring_TFTP_service(): payload = { "directory": "/mnt/tank/tftproot", "username": "******", "newfiles": True } results = PUT("/tftp/", payload) assert isinstance(results.json(), dict), results.text
def test_03_Configuring_TFTP_service(): payload = { "directory": f"/mnt/{pool_name}/tftproot", "username": "******", "newfiles": True } results = PUT("/tftp/", payload) assert isinstance(results.json(), dict), results.text
def test_039_change_recyclebin_to_true(request): depends(request, ["service_cifs_running"], scope="session") global vuid payload = { "recyclebin": True, } results = PUT(f"/sharing/smb/id/{smb_id}", payload) assert results.status_code == 200, results.text vuid = results.json()['vuid']
def test_14_update_disk_description(): updated_description = 'Updated description' results = PUT( f'/disk/id/{DISK_ID}/', { 'description': updated_description } ) assert results.status_code == 200, results.text assert results.json()['description'] == updated_description, results.text
def test_15_update_disk_password(): new_passwd = 'freenas' results = PUT( f'/disk/id/{DISK_ID}', { 'passwd': new_passwd } ) assert results.status_code == 200, results.text assert results.json()['passwd'] == new_passwd
def test_15_update_disk_password(): new_passwd = 'freenas' result = PUT( f'/disk/id/{DISK_ID}', { 'passwd': new_passwd } ) assert result.json()['passwd'] == new_passwd
def test_14_update_disk_description(): updated_description = 'Updated description' result = PUT( f'/disk/id/{DISK_ID}', { 'description': updated_description } ) assert result.json()['description'] == updated_description, result.text
def test_079_change_timemachine_to_true(request): depends(request, ["permissions_job", "service_cifs_running"], scope="session") global vuid payload = { 'timemachine': True, } results = PUT(f"/sharing/smb/id/{smb_id}/", payload) assert results.status_code == 200, results.text vuid = results.json()['vuid']
def test_02_configure_setting_domain_hostname_and_dns(): global payload payload = {"domain": domain, "hostname": hostname, "ipv4gateway": gateway, "nameserver1": BRIDGEDNS} global results results = PUT("/network/configuration/", payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict), results.text
def test_23_change_system_advanced_parameter(): global payload, results payload = { "adv_motd": "Welcome to iXsystems", "adv_powerdaemon": True, "adv_advancedmode": True } results = PUT("/system/advanced/", payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text
def test_08_update_jail_description(): global JAIL_NAME result = PUT( f'/jail/id/{JAIL_NAME}', { 'name': JAIL_NAME + '_renamed' } ) assert result.json() is True, result.text JAIL_NAME += '_renamed'
def test_09_update_jail_description(): if freeze is True: pytest.skip(freeze_msg) global JAIL_NAME results = PUT( f'/jail/id/{JAIL_NAME}/', { 'name': JAIL_NAME + '_renamed' } ) assert results.status_code == 200, results.text assert results.json() is True, results.text JAIL_NAME += '_renamed'
def test_05_updating_variable_name_value_comment_type(): payload = { 'var': VARIABLE + '1', 'value': 'temp', 'comment': 'testing variable', 'type': 'RC', 'enabled': True } results = PUT( f'/tunable/id/{TUNABLE_ID}/', payload ) j_resp = results.json() payload['id'] = TUNABLE_ID assert j_resp == payload, results.text
def test_02_Setting_timezone(): payload = {"stg_timezone": "America/New_York"} results = PUT("/system/settings/", payload) assert results.status_code == 200, results.text assert isinstance(results.json(), dict) is True, results.text