Beispiel #1
0
 def test_01_Removing_a_boot_environment_newbe2(self):
     assert DELETE("/system/bootenv/newbe2/") == 204
Beispiel #2
0
 def test_01_Destroying_ZVOL_01_02(self):
     assert DELETE("/storage/volume/tank/zvols/testzvol1/") == 204
Beispiel #3
0
def test_201_delete_smb_share(request):
    depends(request, ["SMB_SHARE_CREATED"])
    results = DELETE(f"/sharing/smb/id/{smb_id}")
    assert results.status_code == 200, results.text
Beispiel #4
0
def test_14_delete_public_image_with_id(request):
    depends(request, ["pull_public_image"])
    results = DELETE(f'/container/image/id/{public_image_id}/')
    assert results.status_code == 200, results.text
    assert results.json() is None, results.text
def test_23_deleting_user_testuser(request):
    depends(request, ["user_02", "user_01"])
    results = DELETE(f"/user/id/{user_id}/", {"delete_group": True})
    assert results.status_code == 200, results.text
def test_54_destroying_home_dataset(request):
    depends(request, ["HOME_DS_CREATED"])
    results = DELETE(f"/pool/dataset/id/{dataset_url}/")
    assert results.status_code == 200, results.text
Beispiel #7
0
def test_29_Delete_iSCSI_extent():
    results = DELETE("/services/iscsi/extent/1/", None)
    assert results.status_code == 204, results.text
Beispiel #8
0
def test_23_Destroying_SMB_dataset():
    results = DELETE("/storage/volume/1/datasets/%s/" % DATASET)
    assert results.status_code == 204, results.text
Beispiel #9
0
 def test_01_Delete_rsync_resource(self):
     assert DELETE("/services/rsyncmod/1/") == 204
Beispiel #10
0
def test_28_Delete_iSCSI_target():
    results = DELETE("/services/iscsi/target/1/", None)
    assert results.status_code == 204, results.text
Beispiel #11
0
def test_20_delete_child_dataset(request):
    depends(request, ["HAS_NFS4_ACLS"])
    result = DELETE(
        f'/pool/dataset/id/{subdataset_url}/'
    )
    assert result.status_code == 200, result.text
Beispiel #12
0
def test_38_delete_openvpn_jail():
    payload = {'force': True}
    results = DELETE(f'/jail/id/openvpn/', payload)
    assert results.status_code == 200, results.text
Beispiel #13
0
def test_26_delete_rslsync_plugin():
    results = DELETE('/plugin/id/rslsync/')
    assert results.status_code == 200, results.text
Beispiel #14
0
def test_26_Delete_iSCSI_extent():
    results = DELETE("/iscsi/extent/id/1/")
    assert results.json(), results.text
Beispiel #15
0
def test_15_Destroying_ZFS_snapshot_IXBUILD_ROOT_ZVOL_test():
    results = DELETE("/storage/snapshot/tank@test/", None)
    assert results.status_code == 204, results.text
def test_38_delete_transmission_jail(request):
    depends(request, ["pool_04"], scope="session")
    payload = {'force': True}
    results = DELETE('/jail/id/transmission/', payload)
    assert results.status_code == 200, results.text
Beispiel #17
0
def test_17_Destroying_ZVOL_02_02():
    results = DELETE("/storage/volume/tank/zvols/testzvol2/", None)
    assert results.status_code == 204, results.text
Beispiel #18
0
def test_07_delete_tftp_dataset():
    results = DELETE(f"/pool/dataset/id/{dataset_url}/")
    assert results.status_code == 200, results.text
Beispiel #19
0
def test_10_deleting_tunable():
    results = DELETE(f'/tunable/id/{TUNABLE_ID}/', None)
    assert results.status_code == 200, results.text
def test_45_deleting_homedir_user(request):
    depends(request, ["USER_CREATED"])
    results = DELETE(f"/user/id/{user_id}/", {"delete_group": True})
    assert results.status_code == 200, results.text
Beispiel #21
0
def test_12_delete_dataset(request):
    depends(request, ["pool_04"], scope="session")
    results = DELETE(f"/pool/dataset/id/{dataset_url}/")
    assert results.status_code == 200, results.text
Beispiel #22
0
def test_200_delete_smb_user(request):
    depends(request, ["SMB_USER_CREATED"])
    results = DELETE(f"/user/id/{smbuser_id}/", {"delete_group": True})
    assert results.status_code == 200, results.text
Beispiel #23
0
def test_14_Destroying_dataset():
    results = DELETE(f"/storage/volume/{pool_name}/datasets/{DATASET}/")
    assert results.status_code == 204, results.text
Beispiel #24
0
def test_205_destroying_smb_dataset(request):
    depends(request, ["SMB_DATASET_CREATED"])
    results = DELETE(f"/pool/dataset/id/{dataset_url}/")
    assert results.status_code == 200, results.text
Beispiel #25
0
def test_02_delete_used_certificate():
    # FIXME:
    # 1. This really is a test for CRUDService.check_dependencies
    # 2. This idmap API usage looks terribly wrong
    results = POST('/idmap/domain/', {'name': '20191003'})
    assert results.status_code == 200, results.text
    idmap_domain_id = results.json()['id']
    try:
        results = POST(
            '/idmap/rfc2307/', {
                'range_low': 1000,
                'range_high': 2000,
                'domain': {
                    'id': idmap_domain_id,
                },
                'bind_path_user': '',
                'bind_path_group': '',
                'ldap_domain': '',
                'ldap_url': '',
                'ldap_user_dn': '',
                'ldap_user_dn_password': '',
                'ldap_realm': '',
                'certificate': 1,
            })
        assert results.status_code == 200, results.text
        idmap_rfc2307_id = results.json()['id']
        try:
            results = DELETE('/certificate/id/1/')
            assert results.status_code == 200, results.text
            job_id = int(results.text)

            while True:
                get_job = GET(f'/core/get_jobs/?id={job_id}')
                assert get_job.status_code == 200, results.text
                job_status = get_job.json()[0]
                if job_status['state'] in ('RUNNING', 'WAITING'):
                    sleep(5)
                else:
                    assert (job_status['state'] == 'FAILED'
                            and job_status['exc_info']['extra'] == {
                                'dependencies': [
                                    {
                                        'datastore':
                                        'directoryservice.idmap_rfc2307',
                                        'service': 'idmap.rfc2307',
                                        'objects': [ANY],
                                    },
                                    {
                                        'datastore': 'system.settings',
                                        'service': 'system.general',
                                        'key': ['guicertificate'],
                                    },
                                ]
                            } and job_status['exc_info']['extra']
                            ['dependencies'][0]['objects'][0]['id']
                            == idmap_rfc2307_id, ), get_job.text
                    break
        finally:
            results = DELETE(f'/idmap/rfc2307/id/{idmap_rfc2307_id}/')
            assert results.status_code == 200, results.text
    finally:
        results = DELETE(f'/idmap/domain/id/{idmap_domain_id}/')
        assert results.status_code == 200, results.text
Beispiel #26
0
def test_20_deleting_user_testuser():
    userid = GET('/user?username=testuser').json()[0]['id']
    results = DELETE("/user/id/%s" % userid, {"delete_group": True})
    assert results.status_code == 200, results.text
Beispiel #27
0
 def test_22_Destroying_SMB_dataset(self):
     assert DELETE("/storage/volume/1/datasets/%s/" % DATASET) == 204
Beispiel #28
0
 def test_01_Destroying_ZFS_snapshot_IXBUILD_ROOT_ZVOL_test(self):
     assert DELETE("/storage/snapshot/tank@test/") == 204
Beispiel #29
0
def test_19_delete_group_testgroup_newgroup():
    results = DELETE(f"/group/id/{groupid}/", {"delete_users": True})
    assert results.status_code == 200, results.text
Beispiel #30
0
def test_25_Delete_ISCSI_target():
    results = DELETE("/iscsi/target/id/1/")
    assert results.json(), results.text
Beispiel #31
0
def test_30_delete_group_smb_newgroup(request):
    depends(request, ["SMB_GROUP_CREATED"])
    results = DELETE(f"/group/id/{groupid}/", {"delete_users": True})
    assert results.status_code == 200, results.text
Beispiel #32
0
def test_27_Delete_portal():
    results = DELETE("/iscsi/portal/id/1/")
    assert results.json(), results.text
def test_26_delete_transmission_plugin(request):
    depends(request, ["pool_04"], scope="session")
    results = DELETE('/plugin/id/transmission/')
    assert results.status_code == 200, results.text