Commit f049825d authored by chiaming2000's avatar chiaming2000
Browse files

Merge commit 36a343fb.

parents 24ab2cc0 36a343fb
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import org.junit.Test;

import com.seagate.kinetic.IntegrationTestCase;
import com.seagate.kinetic.IntegrationTestLoggerFactory;
import com.seagate.kinetic.proto.Kinetic.Command.Status.StatusCode;

/**
 * Kinetic Administrator Client Basic API Test.
@@ -1712,7 +1713,8 @@ public class KineticAdminTest extends IntegrationTestCase {
            getAdminClient().getLog();
            fail("Should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("DEVICE_LOCKED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.DEVICE_LOCKED));
        }

        // clean up: unlock device
@@ -1744,7 +1746,8 @@ public class KineticAdminTest extends IntegrationTestCase {
            getAdminClient().lockDevice(incorrectLockPinB);
            fail("should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("NOT_AUTHORIZED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.NOT_AUTHORIZED));
        }

        try {
@@ -1867,14 +1870,16 @@ public class KineticAdminTest extends IntegrationTestCase {
            getAdminClient().unLockDevice(incorrectunLockPinB);
            fail("should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("NOT_AUTHORIZED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.NOT_AUTHORIZED));
        }

        try {
            getAdminClient().getLog();
            fail("should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("DEVICE_LOCKED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.DEVICE_LOCKED));
        }

        // clean up: unlock device
+6 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import kinetic.client.KineticException;
import org.junit.Test;

import com.seagate.kinetic.IntegrationTestCase;
import com.seagate.kinetic.proto.Kinetic.Command.Status.StatusCode;

/**
 *
@@ -95,7 +96,8 @@ public class PINTest extends IntegrationTestCase {
            getAdminClient().setErasePin(oldIncorrectErasePin, newErasePin);
            fail("should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("NOT_AUTHORIZED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.NOT_AUTHORIZED));
        }

        try {
@@ -159,7 +161,8 @@ public class PINTest extends IntegrationTestCase {
            getAdminClient().setErasePin(oldIncorrectErasePin, newErasePin);
            fail("should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("NOT_AUTHORIZED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.NOT_AUTHORIZED));
        }

        try {
+3 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import com.seagate.kinetic.SimulatorOnly;
import org.junit.Test;

import com.seagate.kinetic.IntegrationTestCase;
import com.seagate.kinetic.proto.Kinetic.Command.Status.StatusCode;

public class PinOpTest extends IntegrationTestCase {

@@ -34,7 +35,8 @@ public class PinOpTest extends IntegrationTestCase {
            getAdminClient().getLog();
            fail("Should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("DEVICE_LOCKED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.DEVICE_LOCKED));
        }

        // clean up: unlock device and then instant erase
+3 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import kinetic.client.KineticException;
import org.junit.Test;

import com.seagate.kinetic.IntegrationTestCase;
import com.seagate.kinetic.proto.Kinetic.Command.Status.StatusCode;

public class SecurityEraseTest extends IntegrationTestCase {

@@ -59,7 +60,8 @@ public class SecurityEraseTest extends IntegrationTestCase {
            getAdminClient().instantErase(wrongPin);
            fail("should throw exception");
        } catch (KineticException e) {
            assertTrue(e.getMessage().contains("NOT_AUTHORIZED"));
            assertTrue(e.getResponseMessage().getCommand().getStatus()
                    .getCode().equals(StatusCode.NOT_AUTHORIZED));
        }

        try {