Example #1
0
static int
stmfRemoveFromTargetGroup003()
{
	int stmfRet;
	int ret = 0;
	stmfDevid devid;

	stmfRet = stmfRemoveFromTargetGroup(NULL, &devid);
	if (stmfRet != STMF_ERROR_INVALID_ARG) {
		ret = 1;
	}

	return (ret);
}
Example #2
0
static int
stmfRemoveFromTargetGroup002()
{
	int ret = 0;
	int stmfRet;
	uchar_t wwn[8];
	char *groupName = "TG";
	stmfDevid devid;

	bzero(&devid, sizeof (devid));

	wwn[0] = 0x01;
	wwn[1] = 0x23;
	wwn[2] = 0x45;
	wwn[3] = 0x67;
	wwn[4] = 0x89;
	wwn[5] = 0xab;
	wwn[6] = 0xcd;
	wwn[7] = 0xef;

	stmfRet = stmfDevidFromWwn(wwn, &devid);
	if (stmfRet != STMF_STATUS_SUCCESS) {
		ret = 1;
		goto cleanup;
	}

	(void) system("svcadm disable -s stmf");

	stmfRet = stmfRemoveFromTargetGroup((stmfGroupName *)groupName,
	    &devid);
	if (stmfRet != STMF_ERROR_GROUP_NOT_FOUND) {
		ret = 2;
		goto cleanup;
	}

cleanup:
	(void) system("svcadm enable -rs stmf");
	return (ret);
}