def parent_snapshot_test():
        """
        Do parent snapshot test
        """

        cmd_result = virsh.snapshot_parent(vm_name, snap_parent_opt,
                                           readonly=readonly)

        # check status
        if pstatus_error == "yes":
            if cmd_result.exit_status == 0:
                raise error.TestFail("Unexpected success")
            else:
                logging.info("Run failed as expected:%s", cmd_result.stderr)
        elif cmd_result.exit_status != 0:
            raise error.TestFail("Run failed with right command:%s" %
                                 cmd_result.stderr)
        else:
            parent_snapshot_check(cmd_result.stdout.strip())
    def parent_snapshot_test():
        """
        Do parent snapshot test
        """

        cmd_result = virsh.snapshot_parent(vm_name, snap_parent_opt,
                                           readonly=readonly)

        # check status
        if pstatus_error == "yes":
            if cmd_result.exit_status == 0:
                raise error.TestFail("Unexpected success")
            else:
                logging.info("Run failed as expected:%s", cmd_result.stderr)
        elif cmd_result.exit_status != 0:
            raise error.TestFail("Run failed with right command:%s" %
                                 cmd_result.stderr)
        else:
            parent_snapshot_check(cmd_result.stdout.strip())