Commit 7a71096d authored by lichenchong's avatar lichenchong
Browse files

1. Add instantErase(byte[] pin) for KineticAdminClient API.

2.Clean up test cases.
parent 486980f3
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -144,7 +144,8 @@ public class DefaultAdminClient implements KineticAdminClient {
        this.kineticClient.close();
    }

    public void SecureErase(byte[] pin) throws KineticException {
    @Override
    public void instantErase(byte[] pin) throws KineticException {

        KineticMessage km = MessageFactory.createKineticMessageWithBuilder();

@@ -258,8 +259,7 @@ public class DefaultAdminClient implements KineticAdminClient {
                        .newBuilder();
                scope.setOffset(domainInfo.getOffset());
                scope.setValue(ByteString.copyFromUtf8(domainInfo.getValue()));
                for (kinetic.admin.Role role : domainInfo
                        .getRoles()) {
                for (kinetic.admin.Role role : domainInfo.getRoles()) {
                    scope.addPermission(com.seagate.kinetic.proto.Kinetic.Message.Security.ACL.Permission
                            .valueOf(role.toString()));
                }
+119 −103
Original line number Diff line number Diff line
@@ -126,6 +126,22 @@ public interface KineticAdminClient {
     */
    public void setSecurity(List<ACL> acls) throws KineticException;

    /**
     * Erase all data in database for the drive.
     * <p>
     * Erase data in database with Db API.
     * <p>
     * 
     * @param pin
     *            Compare the pin with drive's pin. If equal, can download
     *            firmware the information for the drive, if not, drive will
     *            reject the firmwareDownload request.
     * 
     * @throws KineticException
     *             if unable to load firmware bytes to the drive.
     */
    public void instantErase(byte[] pin) throws KineticException;

    /**
     * Close the connection and release all resources allocated by this
     * instance.
+0 −7
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@ public class IntegrationTestCase {
    private DefaultAdminClient adminClient;
    private AbstractIntegrationTestTarget testTarget;

    // private KineticTestSimulator kineticTestServer;

    /**
     * Initialize a test server and a Kinetic client.
     * <p>
@@ -162,11 +160,6 @@ public class IntegrationTestCase {
     * <p>
     */
    protected String testEndInfo() {
        //		String className = Thread.currentThread().getStackTrace()[2]
        //				.getClassName();
        //		String methodName = Thread.currentThread().getStackTrace()[2]
        //				.getMethodName();
        //		return (className + "#" + methodName + " test finished and passed.");
        return ("status=success");
    }

+1459 −643

File changed.

Preview size limit exceeded, changes collapsed.

+1 −18
Original line number Diff line number Diff line
@@ -72,26 +72,12 @@ public class microPerfTest extends IntegrationTestCase {
		microAsync("Async Run1", op_count, 1024);
		microAsync("Async Run2", op_count, 16 * 1024);
		microAsync("Async Run3", op_count, 32 * 1024);
		// microAsync("Async Run4", op_count, 1024 * 1024);

		// System.out.println("");
		//
		// microAsyncWithTag("Async with tag Run1", 1000, 1024);
		// microAsyncWithTag("Async with tag Run2", 1000, 16 * 1024);
		// microAsyncWithTag("Async with tag Run3", 1000, 32 * 1024);

		System.out.println("");

		microSync("Sync Run1", op_count, 1024);
		microSync("Sync Run2", op_count, 16 * 1024);
		microSync("Sync Run3", op_count, 32 * 1024);
		// microSync("Sync Run4", op_count, 1024 * 1024);

		// System.out.println("");
		//
		// microSyncWithTag("Sync with tag Run1", 1000, 1024);
		// microSyncWithTag("Sync with tag Run2", 1000, 16 * 1024);
		// microSyncWithTag("Sync with tag Run3", 1000, 32 * 1024);

		System.out.println("");

@@ -100,8 +86,6 @@ public class microPerfTest extends IntegrationTestCase {
				16 * 1024);
		microAsyncWithPersistOption("Async Persist_ASYNC Run3", op_count,
				32 * 1024);
		// microAsyncWithPersistOption("Async option_ASYNC Run4", op_count,
		// 1024 * 1024);

		System.out.println("");

@@ -110,8 +94,7 @@ public class microPerfTest extends IntegrationTestCase {
				16 * 1024);
		microSyncWithPersistOption("Sync Persist_ASYNC Run3", op_count,
				32 * 1024);
		// microSyncWithPersistOption("Sync option_ASYNC Run4", op_count,
		// 1024 * 1024);
		
		logger.info(this.testEndInfo());

	}
Loading