Loading bin/runConformanceTests.sh +9 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ PORT=8123 SSL_PORT=8443 HOME=`cd ~; pwd` USE_SSL=false ISE=false JAVA="" if [ "$JAVA_HOME" != "" ]; then Loading Loading @@ -41,11 +42,12 @@ printUsage(){ echo " -tlsport ssl connection port, defalt is 8443" echo " -home drive or simulator home, default is user home path" echo " -ssl true or false, default is false, run test without ssl connecttion" echo " -ise true or false, default is false, use ise or not before test" } if [ $# -eq 0 ]; then exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST com.seagate.kinetic.allTests.ConformanceTestRunner exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST -DISE=$ISE com.seagate.kinetic.allTests.ConformanceTestRunner exit 0 fi Loading Loading @@ -82,6 +84,11 @@ do USE_SSL=$2 shift ;; -ise) echo "Print ssl \"$2\"" ISE=$2 shift ;; -usesocketlog) echo "Print usesocketlog \"$2\"" USE_SOCKET_LOG=$2 Loading Loading @@ -112,6 +119,6 @@ do shift done exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST -DKINETIC_PORT=$PORT -DKINETIC_SSL_PORT=$SSL_PORT -DKINETIC_HOME=$HOME com.seagate.kinetic.allTests.ConformanceTestRunner exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST -DKINETIC_PORT=$PORT -DKINETIC_SSL_PORT=$SSL_PORT -DKINETIC_HOME=$HOME -DISE=$ISE com.seagate.kinetic.allTests.ConformanceTestRunner exit 0 kinetic-test/src/test/java/com/seagate/kinetic/ExternalTestTarget.java +85 −84 Original line number Diff line number Diff line Loading @@ -16,6 +16,15 @@ */ package com.seagate.kinetic; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; import kinetic.client.KineticException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Charsets; import com.google.common.base.Throwables; import com.google.common.cache.CacheBuilder; Loading @@ -26,15 +35,6 @@ import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.Session; import kinetic.client.KineticException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; public class ExternalTestTarget extends AbstractIntegrationTestTarget { private static final Logger logger = LoggerFactory Loading @@ -48,13 +48,14 @@ public class ExternalTestTarget extends AbstractIntegrationTestTarget { if (clearExistingDatabase) { if (Boolean.getBoolean("FAST_CLEAN_UP")) { clearDatabaseUsingSSH(host); } else { } else if (Boolean.getBoolean(System.getProperty("ISE", "true"))) { performISE(); } else { } } } // Cache SSH sessions to avoid the overhead of setting up and tearing down // Cache SSH sessions to avoid the overhead of setting up and tearing downrm // SSH connections to the target // before and after every test as part of the erase process @SuppressWarnings("unused") Loading kinetic-test/src/test/java/com/seagate/kinetic/IntegrationTestCase.java +364 −349 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import kinetic.client.p2p.KineticP2pClient; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeSuite; import org.testng.annotations.DataProvider; import com.google.protobuf.ByteString; Loading Loading @@ -112,11 +113,25 @@ public class IntegrationTestCase { testTarget.shutdown(); } // @BeforeMethod(alwaysRun = true) // protected void securityEraseTarget() throws KineticException { // getAdminClient().secureErase( // "NULL".getBytes(Charset.forName("UTF-8"))); // } @BeforeSuite(alwaysRun = true) protected void securityEraseTarget() throws KineticException { if (Boolean.parseBoolean(System.getProperty("RUN_AGAINST_EXTERNAL"))) { AdminClientConfiguration acc = new AdminClientConfiguration(); acc.setHost(System.getProperty("KINETIC_HOST", "127.0.0.1")); acc.setPort(Integer.parseInt(System.getProperty("KINETIC_SSL_PORT", "8443"))); KineticAdminClient kac = KineticAdminClientFactory .createInstance(acc); String oldErasePin = System.getProperty("OLD_PIN", ""); String newErasePin = System.getProperty("NEW_PIN", "123"); kac.setErasePin(toByteArray(oldErasePin), toByteArray(newErasePin)); kac.instantErase(toByteArray(newErasePin)); kac.close(); } } /** * Get a Kinetic client. Loading kinetic-test/src/test/java/com/seagate/kinetic/KineticTestHelpers.java +96 −11 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import kinetic.admin.Role; import kinetic.client.AsyncKineticException; import kinetic.client.CallbackHandler; import kinetic.client.CallbackResult; import kinetic.client.Entry; import kinetic.client.KineticClient; import kinetic.client.KineticException; Loading Loading @@ -109,8 +110,8 @@ public class KineticTestHelpers { }; } public static void instantErase(String oldErasePin, String newErasePin, KineticAdminClient client) throws KineticException { public static void instantErase(String oldErasePin, String newErasePin, KineticAdminClient client) throws KineticException { byte[] oldErasePinB = toByteArray(oldErasePin); byte[] newErasePinB = toByteArray(newErasePin); Loading @@ -120,18 +121,102 @@ public class KineticTestHelpers { public static void cleanData(int keyCount, KineticClient client) throws KineticException { for (int i = 0; i < keyCount; i++) { byte[] key = toByteArray("key" + i); int keySize = keyCount - 1; boolean flag = true; byte[] keyB = toByteArray("key0"); while (flag) { client.deleteForced(keyB); Entry enN = client.getNext(keyB); if (enN == null) { flag = false; } else if (new String(enN.getKey(), Charset.forName("UTF-8")) .equals("key" + keySize)) { flag = false; client.deleteForced(enN.getKey()); } else { keyB = enN.getKey(); } } } public static void cleanData(byte[] startKey, byte[] endKey, KineticClient client) throws KineticException { boolean flag = true; while (flag) { client.deleteForced(startKey); Entry enN = client.getNext(startKey); if (enN == null) { flag = false; } else if (new String(enN.getKey(), Charset.forName("UTF-8")) .equals(new String(endKey, Charset.forName("UTF-8")))) { flag = false; client.deleteForced(enN.getKey()); } else { startKey = enN.getKey(); } } } public static void cleanNextData(byte[] key, KineticClient client) throws KineticException { boolean flag = true; while (flag) { Entry enN = client.getNext(key); if (enN == null) { flag = false; client.deleteForced(key); } else { client.deleteForced(key); key = enN.getKey(); } } } public static void cleanPreviousData(byte[] key, KineticClient client) throws KineticException { boolean flag = true; while (flag) { Entry enN = client.getPrevious(key); if (enN == null) { flag = false; client.deleteForced(key); } else { client.deleteForced(key); key = enN.getKey(); } } } public static void cleanKVGenData(int keyCount, KineticClient client) throws KineticException { KVGenerator kvGen = new KVGenerator(); String lastKey = ""; for (int i = 0; i < keyCount; i++) { byte[] key = toByteArray(kvGen.getNextKey()); client.deleteForced(key); lastKey = kvGen.getNextKey(); } boolean flag = true; KVGenerator kvGen1 = new KVGenerator(); byte[] keyB = toByteArray(kvGen1.getNextKey()); while (flag) { client.deleteForced(keyB); Entry enN = client.getNext(keyB); if (enN == null) { flag = false; } else if (new String(enN.getKey(), Charset.forName("UTF-8")) .equals(lastKey)) { flag = false; client.deleteForced(enN.getKey()); } else { keyB = enN.getKey(); } } } Loading kinetic-test/src/test/java/com/seagate/kinetic/adminAPI/KineticAdminTest.java +20 −18 Original line number Diff line number Diff line Loading @@ -94,6 +94,8 @@ public class KineticAdminTest extends IntegrationTestCase { private final byte[] INIT_VALUE = toByteArray("0"); private final byte[] INIT_VERSION = toByteArray("0"); private final long DEFAULT_CLUSTER_VERSION = 0; private String oldPin = System.getProperty("OLD_PIN", ""); private String newPin = System.getProperty("NEW_PIN", "123"); /** * Test setup API, erase data in simulator/drive. The result should be true. Loading @@ -115,7 +117,7 @@ public class KineticAdminTest extends IntegrationTestCase { client.put(new Entry(toByteArray("key"), toByteArray("value"), entryMetadata), toByteArray("0")); instantErase("", "123", getAdminClient()); instantErase(oldPin, newPin, getAdminClient()); assertNull(client.get("key".getBytes())); Loading Loading @@ -1581,7 +1583,7 @@ public class KineticAdminTest extends IntegrationTestCase { getAdminClient().setAcl(acls); Assert.fail("should throw exception."); } catch (KineticException e1) { assertTrue(e1.getMessage().contains("Paramter Exception")); assertTrue(e1.getMessage() != null); } logger.info(this.testEndInfo()); Loading Loading @@ -1675,18 +1677,18 @@ public class KineticAdminTest extends IntegrationTestCase { */ @Test public void testSetSecurity_setErasePin() { String erasePin = "erasePin"; String erasePin = newPin; byte[] erasePinB = toByteArray(erasePin); try { getAdminClient().setErasePin(toByteArray(""), erasePinB); getAdminClient().setErasePin(toByteArray(oldPin), erasePinB); } catch (KineticException e) { Assert.fail("Set erase pin throw exception" + e.getMessage()); } // reset pin try { getAdminClient().setErasePin(erasePinB, toByteArray("")); getAdminClient().setErasePin(erasePinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); } Loading @@ -1703,7 +1705,7 @@ public class KineticAdminTest extends IntegrationTestCase { String oldErasePin = "oldErasePin"; byte[] oldErasePinB = toByteArray(oldErasePin); try { getAdminClient().setErasePin(toByteArray(""), oldErasePinB); getAdminClient().setErasePin(toByteArray(oldPin), oldErasePinB); } catch (KineticException e) { Assert.fail("Change erase pin throw exception" + e.getMessage()); } Loading @@ -1718,7 +1720,7 @@ public class KineticAdminTest extends IntegrationTestCase { // erase pin try { getAdminClient().setErasePin(newErasePinB, toByteArray("")); getAdminClient().setErasePin(newErasePinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); } Loading Loading @@ -1840,20 +1842,20 @@ public class KineticAdminTest extends IntegrationTestCase { */ @Test public void testSetSecurity_setLockPin() { String lockPin = "123"; String lockPin = newPin; byte[] lockPinB = toByteArray(lockPin); try { getAdminClient().setLockPin(toByteArray(""), lockPinB); getAdminClient().setLockPin(toByteArray(oldPin), lockPinB); } catch (KineticException e) { Assert.fail("Set erase pin throw exception" + e.getMessage()); } // erase pin try { getAdminClient().setLockPin(lockPinB, toByteArray("")); getAdminClient().setLockPin(lockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); Assert.fail("erase pin throw exception" + e.getMessage()); } logger.info(this.testEndInfo()); Loading @@ -1868,7 +1870,7 @@ public class KineticAdminTest extends IntegrationTestCase { String oldLockPin = "123"; byte[] oldLockPinB = toByteArray(oldLockPin); try { getAdminClient().setLockPin(toByteArray(""), oldLockPinB); getAdminClient().setLockPin(toByteArray(oldPin), oldLockPinB); } catch (KineticException e) { Assert.fail("Change lock pin throw exception" + e.getMessage()); } Loading @@ -1883,9 +1885,9 @@ public class KineticAdminTest extends IntegrationTestCase { // erase try { getAdminClient().setLockPin(newLockPinB, toByteArray("")); getAdminClient().setLockPin(newLockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); Assert.fail("reset lock pin throw exception" + e.getMessage()); } logger.info(this.testEndInfo()); Loading Loading @@ -2053,7 +2055,7 @@ public class KineticAdminTest extends IntegrationTestCase { // set a lock pin byte[] lockPinB = toByteArray("123"); try { getAdminClient().setLockPin(toByteArray(""), lockPinB); getAdminClient().setLockPin(toByteArray(oldPin), lockPinB); } catch (KineticException e1) { Assert.fail("set lock pin throw exception: " + e1.getMessage()); } Loading @@ -2076,7 +2078,7 @@ public class KineticAdminTest extends IntegrationTestCase { // reset lock pin try { getAdminClient().setLockPin(lockPinB, toByteArray("")); getAdminClient().setLockPin(lockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("reset lock pin throw exception" + e.getMessage()); } Loading Loading @@ -2127,7 +2129,7 @@ public class KineticAdminTest extends IntegrationTestCase { // set a lock pin byte[] lockPinB = toByteArray("123"); try { getAdminClient().setLockPin(toByteArray(""), lockPinB); getAdminClient().setLockPin(toByteArray(oldPin), lockPinB); } catch (KineticException e1) { Assert.fail("set lock pin throw exception: " + e1.getMessage()); } Loading Loading @@ -2155,7 +2157,7 @@ public class KineticAdminTest extends IntegrationTestCase { // reset lock pin try { getAdminClient().setLockPin(lockPinB, toByteArray("")); getAdminClient().setLockPin(lockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("reset lock pin throw exception" + e.getMessage()); } Loading Loading
bin/runConformanceTests.sh +9 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ PORT=8123 SSL_PORT=8443 HOME=`cd ~; pwd` USE_SSL=false ISE=false JAVA="" if [ "$JAVA_HOME" != "" ]; then Loading Loading @@ -41,11 +42,12 @@ printUsage(){ echo " -tlsport ssl connection port, defalt is 8443" echo " -home drive or simulator home, default is user home path" echo " -ssl true or false, default is false, run test without ssl connecttion" echo " -ise true or false, default is false, use ise or not before test" } if [ $# -eq 0 ]; then exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST com.seagate.kinetic.allTests.ConformanceTestRunner exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST -DISE=$ISE com.seagate.kinetic.allTests.ConformanceTestRunner exit 0 fi Loading Loading @@ -82,6 +84,11 @@ do USE_SSL=$2 shift ;; -ise) echo "Print ssl \"$2\"" ISE=$2 shift ;; -usesocketlog) echo "Print usesocketlog \"$2\"" USE_SOCKET_LOG=$2 Loading Loading @@ -112,6 +119,6 @@ do shift done exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST -DKINETIC_PORT=$PORT -DKINETIC_SSL_PORT=$SSL_PORT -DKINETIC_HOME=$HOME com.seagate.kinetic.allTests.ConformanceTestRunner exec "$JAVA" -classpath "$CLASSPATH" -Dkinetic.io.in=true -Dkinetic.io.out=true -DRUN_NIO_TEST=true -DRUN_SSL_TEST=${USE_SSL} -DRUN_AGAINST_EXTERNAL=true -DKINETIC_HOST=$HOST -DKINETIC_PORT=$PORT -DKINETIC_SSL_PORT=$SSL_PORT -DKINETIC_HOME=$HOME -DISE=$ISE com.seagate.kinetic.allTests.ConformanceTestRunner exit 0
kinetic-test/src/test/java/com/seagate/kinetic/ExternalTestTarget.java +85 −84 Original line number Diff line number Diff line Loading @@ -16,6 +16,15 @@ */ package com.seagate.kinetic; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; import kinetic.client.KineticException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Charsets; import com.google.common.base.Throwables; import com.google.common.cache.CacheBuilder; Loading @@ -26,15 +35,6 @@ import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.Session; import kinetic.client.KineticException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; public class ExternalTestTarget extends AbstractIntegrationTestTarget { private static final Logger logger = LoggerFactory Loading @@ -48,13 +48,14 @@ public class ExternalTestTarget extends AbstractIntegrationTestTarget { if (clearExistingDatabase) { if (Boolean.getBoolean("FAST_CLEAN_UP")) { clearDatabaseUsingSSH(host); } else { } else if (Boolean.getBoolean(System.getProperty("ISE", "true"))) { performISE(); } else { } } } // Cache SSH sessions to avoid the overhead of setting up and tearing down // Cache SSH sessions to avoid the overhead of setting up and tearing downrm // SSH connections to the target // before and after every test as part of the erase process @SuppressWarnings("unused") Loading
kinetic-test/src/test/java/com/seagate/kinetic/IntegrationTestCase.java +364 −349 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import kinetic.client.p2p.KineticP2pClient; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeSuite; import org.testng.annotations.DataProvider; import com.google.protobuf.ByteString; Loading Loading @@ -112,11 +113,25 @@ public class IntegrationTestCase { testTarget.shutdown(); } // @BeforeMethod(alwaysRun = true) // protected void securityEraseTarget() throws KineticException { // getAdminClient().secureErase( // "NULL".getBytes(Charset.forName("UTF-8"))); // } @BeforeSuite(alwaysRun = true) protected void securityEraseTarget() throws KineticException { if (Boolean.parseBoolean(System.getProperty("RUN_AGAINST_EXTERNAL"))) { AdminClientConfiguration acc = new AdminClientConfiguration(); acc.setHost(System.getProperty("KINETIC_HOST", "127.0.0.1")); acc.setPort(Integer.parseInt(System.getProperty("KINETIC_SSL_PORT", "8443"))); KineticAdminClient kac = KineticAdminClientFactory .createInstance(acc); String oldErasePin = System.getProperty("OLD_PIN", ""); String newErasePin = System.getProperty("NEW_PIN", "123"); kac.setErasePin(toByteArray(oldErasePin), toByteArray(newErasePin)); kac.instantErase(toByteArray(newErasePin)); kac.close(); } } /** * Get a Kinetic client. Loading
kinetic-test/src/test/java/com/seagate/kinetic/KineticTestHelpers.java +96 −11 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import kinetic.admin.Role; import kinetic.client.AsyncKineticException; import kinetic.client.CallbackHandler; import kinetic.client.CallbackResult; import kinetic.client.Entry; import kinetic.client.KineticClient; import kinetic.client.KineticException; Loading Loading @@ -109,8 +110,8 @@ public class KineticTestHelpers { }; } public static void instantErase(String oldErasePin, String newErasePin, KineticAdminClient client) throws KineticException { public static void instantErase(String oldErasePin, String newErasePin, KineticAdminClient client) throws KineticException { byte[] oldErasePinB = toByteArray(oldErasePin); byte[] newErasePinB = toByteArray(newErasePin); Loading @@ -120,18 +121,102 @@ public class KineticTestHelpers { public static void cleanData(int keyCount, KineticClient client) throws KineticException { for (int i = 0; i < keyCount; i++) { byte[] key = toByteArray("key" + i); int keySize = keyCount - 1; boolean flag = true; byte[] keyB = toByteArray("key0"); while (flag) { client.deleteForced(keyB); Entry enN = client.getNext(keyB); if (enN == null) { flag = false; } else if (new String(enN.getKey(), Charset.forName("UTF-8")) .equals("key" + keySize)) { flag = false; client.deleteForced(enN.getKey()); } else { keyB = enN.getKey(); } } } public static void cleanData(byte[] startKey, byte[] endKey, KineticClient client) throws KineticException { boolean flag = true; while (flag) { client.deleteForced(startKey); Entry enN = client.getNext(startKey); if (enN == null) { flag = false; } else if (new String(enN.getKey(), Charset.forName("UTF-8")) .equals(new String(endKey, Charset.forName("UTF-8")))) { flag = false; client.deleteForced(enN.getKey()); } else { startKey = enN.getKey(); } } } public static void cleanNextData(byte[] key, KineticClient client) throws KineticException { boolean flag = true; while (flag) { Entry enN = client.getNext(key); if (enN == null) { flag = false; client.deleteForced(key); } else { client.deleteForced(key); key = enN.getKey(); } } } public static void cleanPreviousData(byte[] key, KineticClient client) throws KineticException { boolean flag = true; while (flag) { Entry enN = client.getPrevious(key); if (enN == null) { flag = false; client.deleteForced(key); } else { client.deleteForced(key); key = enN.getKey(); } } } public static void cleanKVGenData(int keyCount, KineticClient client) throws KineticException { KVGenerator kvGen = new KVGenerator(); String lastKey = ""; for (int i = 0; i < keyCount; i++) { byte[] key = toByteArray(kvGen.getNextKey()); client.deleteForced(key); lastKey = kvGen.getNextKey(); } boolean flag = true; KVGenerator kvGen1 = new KVGenerator(); byte[] keyB = toByteArray(kvGen1.getNextKey()); while (flag) { client.deleteForced(keyB); Entry enN = client.getNext(keyB); if (enN == null) { flag = false; } else if (new String(enN.getKey(), Charset.forName("UTF-8")) .equals(lastKey)) { flag = false; client.deleteForced(enN.getKey()); } else { keyB = enN.getKey(); } } } Loading
kinetic-test/src/test/java/com/seagate/kinetic/adminAPI/KineticAdminTest.java +20 −18 Original line number Diff line number Diff line Loading @@ -94,6 +94,8 @@ public class KineticAdminTest extends IntegrationTestCase { private final byte[] INIT_VALUE = toByteArray("0"); private final byte[] INIT_VERSION = toByteArray("0"); private final long DEFAULT_CLUSTER_VERSION = 0; private String oldPin = System.getProperty("OLD_PIN", ""); private String newPin = System.getProperty("NEW_PIN", "123"); /** * Test setup API, erase data in simulator/drive. The result should be true. Loading @@ -115,7 +117,7 @@ public class KineticAdminTest extends IntegrationTestCase { client.put(new Entry(toByteArray("key"), toByteArray("value"), entryMetadata), toByteArray("0")); instantErase("", "123", getAdminClient()); instantErase(oldPin, newPin, getAdminClient()); assertNull(client.get("key".getBytes())); Loading Loading @@ -1581,7 +1583,7 @@ public class KineticAdminTest extends IntegrationTestCase { getAdminClient().setAcl(acls); Assert.fail("should throw exception."); } catch (KineticException e1) { assertTrue(e1.getMessage().contains("Paramter Exception")); assertTrue(e1.getMessage() != null); } logger.info(this.testEndInfo()); Loading Loading @@ -1675,18 +1677,18 @@ public class KineticAdminTest extends IntegrationTestCase { */ @Test public void testSetSecurity_setErasePin() { String erasePin = "erasePin"; String erasePin = newPin; byte[] erasePinB = toByteArray(erasePin); try { getAdminClient().setErasePin(toByteArray(""), erasePinB); getAdminClient().setErasePin(toByteArray(oldPin), erasePinB); } catch (KineticException e) { Assert.fail("Set erase pin throw exception" + e.getMessage()); } // reset pin try { getAdminClient().setErasePin(erasePinB, toByteArray("")); getAdminClient().setErasePin(erasePinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); } Loading @@ -1703,7 +1705,7 @@ public class KineticAdminTest extends IntegrationTestCase { String oldErasePin = "oldErasePin"; byte[] oldErasePinB = toByteArray(oldErasePin); try { getAdminClient().setErasePin(toByteArray(""), oldErasePinB); getAdminClient().setErasePin(toByteArray(oldPin), oldErasePinB); } catch (KineticException e) { Assert.fail("Change erase pin throw exception" + e.getMessage()); } Loading @@ -1718,7 +1720,7 @@ public class KineticAdminTest extends IntegrationTestCase { // erase pin try { getAdminClient().setErasePin(newErasePinB, toByteArray("")); getAdminClient().setErasePin(newErasePinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); } Loading Loading @@ -1840,20 +1842,20 @@ public class KineticAdminTest extends IntegrationTestCase { */ @Test public void testSetSecurity_setLockPin() { String lockPin = "123"; String lockPin = newPin; byte[] lockPinB = toByteArray(lockPin); try { getAdminClient().setLockPin(toByteArray(""), lockPinB); getAdminClient().setLockPin(toByteArray(oldPin), lockPinB); } catch (KineticException e) { Assert.fail("Set erase pin throw exception" + e.getMessage()); } // erase pin try { getAdminClient().setLockPin(lockPinB, toByteArray("")); getAdminClient().setLockPin(lockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); Assert.fail("erase pin throw exception" + e.getMessage()); } logger.info(this.testEndInfo()); Loading @@ -1868,7 +1870,7 @@ public class KineticAdminTest extends IntegrationTestCase { String oldLockPin = "123"; byte[] oldLockPinB = toByteArray(oldLockPin); try { getAdminClient().setLockPin(toByteArray(""), oldLockPinB); getAdminClient().setLockPin(toByteArray(oldPin), oldLockPinB); } catch (KineticException e) { Assert.fail("Change lock pin throw exception" + e.getMessage()); } Loading @@ -1883,9 +1885,9 @@ public class KineticAdminTest extends IntegrationTestCase { // erase try { getAdminClient().setLockPin(newLockPinB, toByteArray("")); getAdminClient().setLockPin(newLockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("instant erase throw exception" + e.getMessage()); Assert.fail("reset lock pin throw exception" + e.getMessage()); } logger.info(this.testEndInfo()); Loading Loading @@ -2053,7 +2055,7 @@ public class KineticAdminTest extends IntegrationTestCase { // set a lock pin byte[] lockPinB = toByteArray("123"); try { getAdminClient().setLockPin(toByteArray(""), lockPinB); getAdminClient().setLockPin(toByteArray(oldPin), lockPinB); } catch (KineticException e1) { Assert.fail("set lock pin throw exception: " + e1.getMessage()); } Loading @@ -2076,7 +2078,7 @@ public class KineticAdminTest extends IntegrationTestCase { // reset lock pin try { getAdminClient().setLockPin(lockPinB, toByteArray("")); getAdminClient().setLockPin(lockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("reset lock pin throw exception" + e.getMessage()); } Loading Loading @@ -2127,7 +2129,7 @@ public class KineticAdminTest extends IntegrationTestCase { // set a lock pin byte[] lockPinB = toByteArray("123"); try { getAdminClient().setLockPin(toByteArray(""), lockPinB); getAdminClient().setLockPin(toByteArray(oldPin), lockPinB); } catch (KineticException e1) { Assert.fail("set lock pin throw exception: " + e1.getMessage()); } Loading Loading @@ -2155,7 +2157,7 @@ public class KineticAdminTest extends IntegrationTestCase { // reset lock pin try { getAdminClient().setLockPin(lockPinB, toByteArray("")); getAdminClient().setLockPin(lockPinB, toByteArray(oldPin)); } catch (KineticException e) { Assert.fail("reset lock pin throw exception" + e.getMessage()); } Loading