def METHOD_NAME(self, mirrormode, imagespec):
    """Method to verify write operation should not be performed from secondary site,
    as mirrored image got locked from primary site.
    Args:
        self: mirror2 object
        mirrormode: type of mirroring journal or snapshot
        imagespec: poolname + "/" + imagename
    Returns:
        0 - if test case pass
        1 - if test case fails
    """
    out, err = self.benchwrite(
        imagespec=imagespec, long_running=False, all=True, check_ec=False
    )
    log.debug(err)
    if "Read-only file system" in err:
        log.info(
            "As Expected writing data from secondary got failed, "
            f"mirrored image got locked from primary in {mirrormode} based mirroring"
        )
        return 0
    log.error(
        f"Able to write data into secondary image for {mirrormode} based mirroring,"
        " This is invalid since image should be locked at primary."
    )
    return 1