コード例 #1
0
def test_delete_clone_volume(setup_teardown_for_each_test):

    # first create volume
    clone_vol_name = nimosclientbase.get_unique_string("clone-volumetc")
    resp_vol = create_volume(vol_name1)
    vol_id = resp_vol.attrs.get("id")
    # clone a volume
    snap_resp = nimosclientbase.get_nimos_client().snapshots.create(
        name="test.volumeclone.snapshot", vol_id=vol_id)
    clonevol_resp = nimosclientbase.get_nimos_client().volumes.create(
        name=clone_vol_name,
        base_snap_id=snap_resp.attrs.get("id"),
        clone=True)
    # confirm
    assert clone_vol_name == clonevol_resp.attrs.get("name")
    assert clonevol_resp.attrs.get("size") == resp_vol.attrs.get("size")
    # try deleting parent volume . it should fail with
    # exception "SM_vol_has_clone"
    try:
        nimosclientbase.get_nimos_client().volumes.offline(vol_id)
        nimosclientbase.get_nimos_client().volumes.delete(vol_id)
    except exceptions.NimOSAPIError as ex:
        if "SM_vol_has_clone" in str(ex):
            log("Failed as expected. volume has clone")
            # cleanup
            nimosclientbase.get_nimos_client().volumes.offline(
                clonevol_resp.attrs.get("id"))
            nimosclientbase.get_nimos_client().volumes.delete(
                clonevol_resp.attrs.get("id"))
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #2
0
def test_delete_perf_policies(setup_teardown_for_each_test):
    try:
        # create one
        resp = create_perf_policy(perf_policy_name1,
                                  description="created by testcase",
                                  block_size=8192,
                                  app_category="db2")
        assert resp is not None
        # match the value
        get_resp = nimosclientbase.get_nimos_client().performance_policies.get(
            id=resp.attrs.get("id"))
        assert get_resp is not None
        assert get_resp.attrs.get("id") == performancepolicy_to_delete[0]
        assert get_resp.attrs.get("description") == "created by testcase"
        assert get_resp.attrs.get("block_size") == 8192
        assert get_resp.attrs.get("app_category") == "db2"

        # delete the policy
        delete_resp = nimosclientbase.get_nimos_client(
        ).performance_policies.delete(id=get_resp.attrs.get("id"))
        assert delete_resp.__len__() == 0
        performancepolicy_to_delete.remove(resp.attrs.get("id"))
    except exceptions.NimOSAPIError as ex:
        if "SM_perfpol_invalid_app_category" in str(ex):
            log("Failed as expected. Invalid app category provided.")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #3
0
def cleanup_old_volumes():

    # due to bulk_move operation most of the times when abort is issued.
    # the array ignores the request to delete the volume as the operation
    # is already in progress and hence the volumes are left over.hence,
    # every time this test is run ,we will try to remove the old entries
    log("Cleaning up unwanted volumes if any")
    global delete_volume_counter
    vol_resp = nimosclientbase.get_nimos_client().volumes.list()
    for vol_obj in vol_resp:
        while delete_volume_counter != 0:
            try:
                if (str.startswith(vol_obj.attrs.get("name"), "volumetc-vol")
                        or str.startswith(vol_obj.attrs.get("name"),
                                          "clone-volumetc")):

                    vol_name = vol_obj.attrs.get("name")
                    nimosclientbase.get_nimos_client().volumes.offline(
                        vol_obj.attrs.get("id"))
                    nimosclientbase.get_nimos_client().volumes.delete(
                        vol_obj.attrs.get("id"))
                    log(f"Deleted volume '{vol_name}'")
                    time.sleep(2)
                break  # break from inner while loop
            except exceptions.NimOSAPIError as ex:
                if ("SM_volmv_vol_einprog" in str(ex)
                        or "SM_vol_connection_count_unavailable" in str(ex)):
                    log("'SM_volmv_vol_einprog' in progress.Trying to delete "
                        f"volume '{vol_name}' again after 3 minutes")
                    time.sleep(180)
                    delete_volume_counter = delete_volume_counter - 1
                else:
                    break  # from while loop
            except Exception as ex:
                log(ex)
コード例 #4
0
def test_promote_volcoll(setup_teardown_for_each_test):
    volcoll_resp = create_volcoll(volcoll_name1)
    voloume_name = nimosclientbase.get_unique_string(
        "VolumeCollectionTestCase-addtovolcoll")

    vol_resp = nimosclientbase.get_nimos_client().volumes.create(voloume_name,
                                                                 size=50)
    volume.vol_to_delete.append(vol_resp.attrs.get("id"))
    assert volcoll_resp is not None

    # associate the volume to volcoll
    vol_associate_resp = nimosclientbase.get_nimos_client().volumes.associate(
        id=vol_resp.attrs.get("id"), volcoll=volcoll_resp)
    assert vol_resp is not None
    # check
    assert vol_associate_resp.get("volcoll_name") == volcoll_name1
    assert vol_associate_resp.get("volcoll_id") == volcoll_resp.attrs.get("id")
    # try deleting the volcoll .this should fail as
    # volume has not been disassocited
    try:
        nimosclientbase.get_nimos_client().volume_collections.promote(
            id=volcoll_resp.attrs.get("id"))
    except exceptions.NimOSAPIError as ex:
        if "SM_ealready" in str(ex):
            log("Failed as expected. volcoll is already promoted")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #5
0
def test_move_volume(setup_teardown_for_each_test):

    try:

        # first atleast create volume
        create_volume(vol_name3, size=5)
        # deliberately pass wrong pool id. move operation takes lot of time
        # hence we will just call the sdk api to make sure it takes all
        # the arguments
        moveresp = nimosclientbase.get_nimos_client().volumes.move(
            dest_pool_id="kasdkashdqwkdhkas28623612000ef", id=vol_to_delete[0])
        assert moveresp is not None
        # abort the move now
        for vol_id in vol_to_delete:
            abortresp = nimosclientbase.get_nimos_client().volumes.abort_move(
                vol_id)
            assert abortresp is not None
    except exceptions.NimOSAPIError as ex:
        if ("SM_vol_connection_count_unavailable" in str(ex)
                or "SM_vol_usage_unavailable" in str(ex)):
            log("Failed to abort volume move due to service inavailiability")
        elif "SM_invalid_arg_value" in str(ex):
            log("Failed as expected. Invalid pool id provided")
        else:
            log(ex)
コード例 #6
0
def test_get_protection_schedules(setup_teardown_for_each_test):

    try:
        resp = create_protection_schedule(
            prot_schedule_name1,
            description="created by testcase",
            volcoll_or_prottmpl_id=protection_template_to_delete[0],
            volcoll_or_prottmpl_type="protection_template",
            num_retain=1)
        assert resp is not None
        get_resp = nimosclientbase.get_nimos_client().protection_schedules.get(
            id=resp.attrs.get("id"))
        assert get_resp is not None
        assert get_resp.attrs.get("id") == resp.attrs.get("id")

        # retreive all
        getall_resp = nimosclientbase.get_nimos_client(
        ).protection_schedules.list()
        assert getall_resp is not None
        # by default 6 protection schedule are on array
        assert getall_resp.__len__() >= 6
    except exceptions.NimOSAPIError as ex:
        if "SM_invalid_arg_value" in str(ex):
            log(f"Failed as expected. template name : {prot_template_name1}")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #7
0
def test_bulk_move_volume(setup_teardown_for_each_test):
    try:
        orig_vol_pool_name = ""
        # first atleast create few volume
        resp = create_volume(vol_name3, size=5)
        orig_vol_pool_name = resp.attrs.get("pool_name")
        # get the dest pool id.
        ppol_resp = nimosclientbase.get_nimos_client().pools.list()
        assert ppol_resp is not None
        # make sure we have 2 pools atleaset
        assert ppol_resp.__len__() >= 2
        # get the pool id where to move the volume
        for poolobj in ppol_resp:
            if poolobj.attrs.get("name") == orig_vol_pool_name:
                continue
            else:
                break
        pool_id = poolobj.attrs.get("id")
        # move the volumes
        moveresp = nimosclientbase.get_nimos_client().volumes.bulk_move(
            dest_pool_id=pool_id, vol_ids=vol_to_delete)
        assert moveresp is not None
        # abort the move now
        for vol_id in vol_to_delete:
            abortresp = nimosclientbase.get_nimos_client().volumes.abort_move(
                vol_id)
            assert abortresp is not None
    except exceptions.NimOSAPIError as ex:
        if ("SM_vol_connection_count_unavailable" in str(ex)
                or "SM_vol_usage_unavailable" in str(ex)):
            log("Failed to abort volume move due to service inavailiability")
        elif "SM_invalid_arg_value" in str(ex):
            log("Failed as expected. Invalid pool id provided")
        else:
            log(ex)
コード例 #8
0
def test_update_pools(setup_teardown_for_each_test):
    try:
        resp = nimosclientbase.get_nimos_client().pools.get()
        assert resp is not None
        desc_name = resp.attrs.get("description")
        name = resp.attrs.get("name")
        # update name
        update_resp = nimosclientbase.get_nimos_client().pools.update(
            resp.attrs.get("id"),
            description="modified by testcase",
            name="testcasename")
        assert update_resp is not None
        # assert it got updated
        assert update_resp.attrs.get("description") == "modified by testcase"
        assert update_resp.attrs.get("name") == "testcasename"
        # rename it back
        update_resp = nimosclientbase.get_nimos_client().pools.update(
            resp.attrs.get("id"),
            description=desc_name,
            name=name)
        assert update_resp is not None
    except Exception as ex:
        # fiji and below throws SM_eperm as exception
        if "SM_eperm" in str(ex):
            log("Failed as expected")
コード例 #9
0
def test_delete_snapcoll_with_onlinesnapshot(setup_teardown_for_each_test):
    # should throw ex "SM_vol_has_online_snap"
    snapcoll_resp = create_snapcoll(snapcoll_name1,
                                    volcoll_id=volcoll.volcoll_to_delete[0],
                                    description="created by testcase",
                                    replicate=False,
                                    start_online=True)  # online snapshot
    assert snapcoll_resp is not None
    assert snapcoll_name1 == snapcoll_resp.attrs.get("name")
    assert "created by testcase" == snapcoll_resp.attrs.get("description")
    assert snapcoll_resp.attrs.get("replicate") is False
    # get the snapcoll
    snapcoll_resp = nimosclientbase.get_nimos_client(
    ).snapshot_collections.get(id=snapcoll_resp.attrs.get("id"))
    assert snapcoll_resp
    # try deleting it should throw exception
    try:
        delete_snapcoll()
        volume.delete_volume()
    except exceptions.NimOSAPIError as ex:
        if "SM_vol_has_online_snap" in str(ex):
            log("Failed as expected with exception : 'SM_vol_has_online_snap'")
            # offilne the snapshot
            snapshotlist = snapcoll_resp.attrs.get("snapshots_list")
            for snapid in snapshotlist:
                snapresp = nimosclientbase.get_nimos_client().snapshots.update(
                    id=snapid["id"], online=False)
                assert snapresp is not None
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #10
0
def test_restore_online_volume(setup_teardown_for_each_test):
    try:
        snapshot_resp = None
        # first create volume
        vol_resp = create_volume(vol_name1, size=5)
        snapshot_name1 = nimosclientbase.get_unique_string(
            "volumetc-snapshot1")
        snapshot_resp = nimosclientbase.get_nimos_client().snapshots.create(
            name=snapshot_name1,
            vol_id=vol_to_delete[0],
            description="created by testcase",
            online=False,
            writable=False)
        assert snapshot_resp is not None
        # restore the volume
        vol_restore_resp = nimosclientbase.get_nimos_client().volumes.restore(
            base_snap_id=snapshot_resp.attrs.get("id"),
            id=vol_resp.attrs.get("id"))
        assert vol_restore_resp is not None
    except exceptions.NimOSAPIError as ex:
        if "SM_vol_not_offline_on_restore" in str(ex):
            log("Failed as expected. volume to restore is not offline")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #11
0
def setup_teardown_for_each_test(before_running_all_testcase, request):
    # setup operations before yield is called
    nimosclientbase.log_header(request.function.__name__)
    global vol_name1, snapcoll_name1, volcoll_name1
    volcoll_name1 = nimosclientbase.get_unique_string("snapcolltc-volcoll1")
    snapcoll_name1 = nimosclientbase.get_unique_string("snapcolltc-snapcoll1")
    vol_name1 = nimosclientbase.get_unique_string("snapcolltc-vol1")
    # 1st create a volcoll and 2nd associate a volume to volcoll
    volcoll_resp = volcoll.create_volcoll(volcoll_name1)
    assert volcoll_resp is not None
    # save the volcoll_id here
    volcoll_resp.attrs.get("id")
    # create and associate a volume
    volresp = volume.create_volume(vol_name1)
    try:
        nimosclientbase.get_nimos_client().volumes.update(
            id=volresp.attrs.get("id"),
            volcoll_id=volcoll_resp.attrs.get("id"))
    except exceptions.NimOSAPIError as ex:
        log(f"Failed with exception message : {str(ex)}")
        raise ex
    yield setup_teardown_for_each_test
    # teardown operations below
    delete_snapcoll()
    volume.delete_volume()
    volcoll.delete_volcoll()
    nimosclientbase.log_footer(request.function.__name__)
コード例 #12
0
def test_list_audit_logs(setup_teardown_for_each_test):
    resp = nimosclientbase.get_nimos_client().audit_log.list(limit=5)
    limit = 500
    while 1:
        resp = nimosclientbase.get_nimos_client().audit_log.list(
            limit=limit, from_id=resp[len(resp) - 1].attrs.get("id"))
        if len(resp) < limit:
            break
    assert resp is not None
コード例 #13
0
def test_replication_partners_endrow_beyond(setup_teardown_for_each_test):
    try:
        nimosclientbase.get_nimos_client().replication_partners.get(endRow=30)
    except exceptions.NimOSAPIError as ex:
        if "SM_end_row_beyond_total_rows" in str(ex):
            log("Failed as expected.no rows present")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #14
0
def test_volume_unexpected_arg(setup_teardown_for_each_test):
    try:
        # "invalidarg" is not a part of volume argument.
        nimosclientbase.get_nimos_client().volumes.create(
            vol_name1, size=50, invalidarg="testinvalidarg")
    except exceptions.NimOSAPIError as ex:
        # protocol ex is SM_http_bad_request
        if 'SM_unexpected_arg' in str(ex):
            log("Failed As Expected. "
                f"Unexpected arg for vol_name : {vol_name1}")
コード例 #15
0
def test_update_volume_size_attribute(setup_teardown_for_each_test):
    resp = create_volume(vol_name1)
    # update the size to 100
    resp = nimosclientbase.get_nimos_client().volumes.update(
        id=resp.attrs.get("id"), size=100)
    assert resp is not None
    # check the size is updated correctly
    vol = nimosclientbase.get_nimos_client().volumes.get(
        id=resp.attrs.get("id"), fields="name,id,size")
    assert resp.attrs.get("size") == vol.attrs.get("size")
コード例 #16
0
def test_get_disks_query_params(setup_teardown_for_each_test):
    resp = nimosclientbase.get_nimos_client().disks.list()
    assert resp is not None
    resp = nimosclientbase.get_nimos_client().disks.get(
        array_id=resp[0].attrs.get("array_id"))
    assert resp is not None
    # assert that those fields are present
    assert resp.attrs.get("array_id") is not None
    # try asserting a value which was not querying
    assert resp.attrs.get("startRow") is None
コード例 #17
0
def delete_volume():
    for vol_id in vol_to_delete:
        try:
            # check
            nimosclientbase.get_nimos_client().volumes.offline(vol_id)
            nimosclientbase.get_nimos_client().volumes.delete(vol_id)
            log(f" Deleted volume with id '{vol_id}'")
        except Exception as ex:
            log(ex)
            # raise ex
    vol_to_delete.clear()
コード例 #18
0
def before_running_all_testcase(request):
    log("**** Starting Tests for master_key TestCase *****\n")
    resp = nimosclientbase.get_nimos_client().master_key.get()
    if resp is not None:
        nimosclientbase.get_nimos_client().master_key.delete(
            resp.attrs.get("id"))

    def after_running_all_testcase():
        log("**** Completed Tests for master_key TestCase *****\n")

    request.addfinalizer(after_running_all_testcase)
コード例 #19
0
def test_update_volume_metadata(setup_teardown_for_each_test):
    resp_vol1 = create_volume(vol_name1)
    create_volume(vol_name2)
    metadata = {'key1': 'abcde', 'key_-*1': "xyz"}
    try:
        # update the size to 100
        nimosclientbase.get_nimos_client().volumes.update(
            id=resp_vol1.attrs.get("id"), metadata=metadata)
    except exceptions.NimOSAPIError as ex:
        log(f"Failed with exception message : {str(ex)}")
        raise ex
コード例 #20
0
def test_get_audit_log_query_params(setup_teardown_for_each_test):
    resp = nimosclientbase.get_nimos_client().audit_log.list(detail=True,
                                                             pageSize=2)
    assert resp is not None
    resp = nimosclientbase.get_nimos_client().audit_log.get(
        pageSize=2, fields="user_name,id,status")
    # assert that those fields are present
    assert resp.attrs.get("user_name") is not None
    assert resp.attrs.get("id") is not None
    assert resp.attrs.get("status") is not None
    # try asserting a value which was not querying
    assert resp.attrs.get("startRow") is None
コード例 #21
0
def test_update_volume_metadata(setup_teardown_for_each_test):
    # first atleast create few volume
    resp_vol1 = create_volume(vol_name1)
    create_volume(vol_name2)
    metadata = {'key1': 'abcde'}
    try:
        # update the size to 100
        nimosclientbase.get_nimos_client().volumes.update(
            id=resp_vol1.attrs.get("id"), metadata=metadata)
    except exceptions.NimOSAPIError as ex:
        if 'SM_invalid_keyvalue' in str(ex):
            log("Failed as expected")
コード例 #22
0
def test_test_alert(setup_teardown_for_each_test):
    try:
        resp = nimosclientbase.get_nimos_client().groups.get()
        assert resp is not None
        test_resp = nimosclientbase.get_nimos_client().groups.test_alert(
            id=resp.attrs.get("id"), level="notice")
        test_resp is not None
    except exceptions.NimOSAPIError as ex:
        if "SM_array_not_found" in str(ex):
            log("Failed as expected. Array id given is invalid")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #23
0
def test_update_disks_mandatory_params(setup_teardown_for_each_test):
    resp = nimosclientbase.get_nimos_client().disks.get()
    assert resp is not None
    # update
    try:
        nimosclientbase.get_nimos_client().disks.update(
            id=resp.attrs.get("id"), force=False)
    except exceptions.NimOSAPIError as ex:
        if "SM_missing_arg" in str(ex):
            log("Failed as expected. mandatory param 'disk_op' not provided")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #24
0
def test_get_event_log_query_params(setup_teardown_for_each_test):
    resp = nimosclientbase.get_nimos_client().events.list(detail=True, limit=2)
    assert resp is not None
    resp = nimosclientbase.get_nimos_client().events.get(
        limit=2, fields="activity,id,category,severity")
    assert resp is not None
    # assert that those fields are present
    assert resp.attrs.get("activity") is not None
    assert resp.attrs.get("id") is not None
    assert resp.attrs.get("category") is not None
    assert resp.attrs.get("severity") is not None
    # try asserting a value which was not querying
    assert resp.attrs.get("startRow") is None
コード例 #25
0
def test_invalid_volume_page_size(setup_teardown_for_each_test):
    # first atleast create few volume
    for i in range(0, 6):
        vol_name = nimosclientbase.get_unique_string("volumetc-vol1-" + str(i))
        create_volume(vol_name)
    try:
        nimosclientbase.get_nimos_client().volumes.list(detail=True,
                                                        pageSize=5000)
    except Exception as ex:
        if "SM_too_large_page_size" in str(ex):
            log("Failed as expected. Invaild pagesize given")
        else:
            log(ex)
コード例 #26
0
def test_update_volume_metadata_with_invalid_keypair(
        setup_teardown_for_each_test):
    # first atleast create few volume
    resp_vol1 = create_volume(vol_name1)
    create_volume(vol_name2)
    metadata = {"key1": "abcde", "key2": "xyz"}
    try:
        # update the size to 100
        nimosclientbase.get_nimos_client().volumes.update(
            id=resp_vol1.attrs.get("id"), metadata=metadata)
    except exceptions.NimOSAPIError as ex:
        # covered SM_eexist and SM_http_conflict
        if 'SM_invalid_keyvalue' in str(ex):
            log("Failed as expected")
コード例 #27
0
def test_connectivity_for_replicationpartners(setup_teardown_for_each_test):
    try:
        resp = nimosclientbase.get_nimos_client().replication_partners.get(
            fields="id,name,hostname,repl_hostname,pool_name")
        if resp is not None:
            # tests the connection
            nimosclientbase.get_nimos_client().replication_partners.test(
                id=resp.attrs.get("id"))
        else:
            log("Ignoring this testcase."
                "This testcase should be run only on replication setup")
    except exceptions.NimOSAPIError as ex:
        log(f"Failed with exception message : {str(ex)}")
        raise ex
コード例 #28
0
def test_handover_volcoll(setup_teardown_for_each_test):
    volcoll_resp = create_volcoll(volcoll_name1)
    assert volcoll_resp is not None
    try:
        nimosclientbase.get_nimos_client().volume_collections.handover(
            id=volcoll_resp.attrs.get("id"),
            replication_partner_id="1264126491231239123hgghsjhd")
    except exceptions.NimOSAPIError as ex:
        if "SM_invalid_arg_value" in str(ex):
            log("Failed as expected. "
                "Invalid value provided for replication_partner_id")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
コード例 #29
0
def test_activateshelve(setup_teardown_for_each_test):
    resp = nimosclientbase.get_nimos_client().shelves.get()
    assert resp is not None
    try:
        resp = nimosclientbase.get_nimos_client().shelves.update(
            id=resp.attrs.get("id"), force=True, activated=True)
        assert resp.attrs.get("activated") is True
    except exceptions.NimOSAPIError as ex:
        if "SM_shelf_no_eloc_id" in str(ex):
            log("making test as passed since no shelve exist for expansion")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex
    assert resp is not None
コード例 #30
0
def test_async_replication_workflow(setup_teardown_for_each_test):

    # steps involved.
    # 1.check if we have replication setup.
    # 2.create a volume, volcoll and snapcoll on upstream array
    # 3.create a periodic snapshot schedule for the volcoll
    # 4.see if the snapshot got replicated
    try:
        # step 1.
        log("Creating replication setup")
        add_replication_partner()
        # step 2
        log("Creating a volume, volcoll and snapcoll on upstream array")
        volcoll_resp = volcoll.create_volcoll(volcoll_name1)
        assert volcoll_resp is not None
        vol_resp = volume.create_volume(vol_name1, size=5)
        assert vol_resp is not None
        # associate the volume to volcoll
        vol_associate_resp = nimosclientbase.get_nimos_client(
        ).volumes.associate(id=vol_resp.attrs.get("id"), volcoll=volcoll_resp)
        assert vol_associate_resp is not None
        # step 3
        log("Creating Replicated periodic snapshot schedule for the volcoll")
        downstream_partner_id = get_downstream_partner_id()
        log(f"Got downstream_partner_id as '{downstream_partner_id}'")
        resp = prot_sched.create_protection_schedule(
            prot_sched.prot_schedule_name1,
            description="created by testcase for replication",
            volcoll_or_prottmpl_id=volcoll_resp.attrs.get("id"),
            volcoll_or_prottmpl_type="volume_collection",
            period=1,
            period_unit="minutes",
            at_time=0,
            until_time=86399,
            days="all",
            num_retain=1,
            downstream_partner="group-alokr8-va",
            downstream_partner_id=get_downstream_partner_id(),
            replicate_every=1,
            num_retain_replica=1)
        assert resp is not None
        # step 4 verify if the snapshot got replicated
        # sleep for sometime and then check if snapshot is replicated
        log("Waiting for 2 minutes for snapshot to be replicated")
        time.sleep(121)
        max_retry = 3
        retry = 1
        while is_snapshot_replicated(vol_resp) is False and retry < max_retry:
            time.sleep(30)
            retry += 1
        if retry == max_retry:
            raise Exception("Snapshot was not replicated")
        else:
            log("Snapshot Successfully replicated.")
    except exceptions.NimOSAPIError as ex:
        if "SM_invalid_arg" in str(ex):
            log(f"Failed as expected . snapshot name {ex}")
        else:
            log(f"Failed with exception message : {str(ex)}")
            raise ex