Loading test/support/system_test_fixture.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ #endif #ifndef SESSION_PIN #define SESSION_PIN "123" #define SESSION_PIN "1234" #endif #ifndef SESSION_IDENTITY Loading test/system/test_system_lock_unlock.c +19 −12 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ #include "system_test_fixture.h" #include "kinetic_admin_client.h" static char OldPinData[4]; static char NewPinData[4]; static char OldPinData[8]; static char NewPinData[8]; static ByteArray OldPin, NewPin; static bool NewPinSet; static bool Locked; Loading Loading @@ -84,7 +84,7 @@ void setUp(void) TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); // Set the erase PIN to something non-empty strcpy(NewPinData, "123"); strcpy(NewPinData, SESSION_PIN); OldPin = ByteArray_Create(OldPinData, 0); NewPin = ByteArray_Create(NewPinData, strlen(NewPinData)); status = KineticAdminClient_SetLockPin(Fixture.adminSession, Loading Loading @@ -123,6 +123,12 @@ void test_KineticAdmin_should_lock_and_unlock_a_device(void) TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); Locked = true; /* Currently, the device appears to just hang up on us rather than * returning DEVICE_LOCKED (unlike the simulator). Some sort of * command here to confirm that the device lock succeeded would * be a better test. We need to check if the drive has another * interface that exposes this. */ if (SystemTestIsUnderSimulator()) { // Validate the object cannot being accessed while locked KineticEntry getEntry = { .key = KeyBuffer, Loading @@ -132,6 +138,7 @@ void test_KineticAdmin_should_lock_and_unlock_a_device(void) }; status = KineticClient_Get(Fixture.session, &getEntry, NULL); TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_DEVICE_LOCKED, status); } status = KineticAdminClient_UnlockDevice(Fixture.adminSession, NewPin); TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); Loading Loading
test/support/system_test_fixture.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ #endif #ifndef SESSION_PIN #define SESSION_PIN "123" #define SESSION_PIN "1234" #endif #ifndef SESSION_IDENTITY Loading
test/system/test_system_lock_unlock.c +19 −12 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ #include "system_test_fixture.h" #include "kinetic_admin_client.h" static char OldPinData[4]; static char NewPinData[4]; static char OldPinData[8]; static char NewPinData[8]; static ByteArray OldPin, NewPin; static bool NewPinSet; static bool Locked; Loading Loading @@ -84,7 +84,7 @@ void setUp(void) TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); // Set the erase PIN to something non-empty strcpy(NewPinData, "123"); strcpy(NewPinData, SESSION_PIN); OldPin = ByteArray_Create(OldPinData, 0); NewPin = ByteArray_Create(NewPinData, strlen(NewPinData)); status = KineticAdminClient_SetLockPin(Fixture.adminSession, Loading Loading @@ -123,6 +123,12 @@ void test_KineticAdmin_should_lock_and_unlock_a_device(void) TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); Locked = true; /* Currently, the device appears to just hang up on us rather than * returning DEVICE_LOCKED (unlike the simulator). Some sort of * command here to confirm that the device lock succeeded would * be a better test. We need to check if the drive has another * interface that exposes this. */ if (SystemTestIsUnderSimulator()) { // Validate the object cannot being accessed while locked KineticEntry getEntry = { .key = KeyBuffer, Loading @@ -132,6 +138,7 @@ void test_KineticAdmin_should_lock_and_unlock_a_device(void) }; status = KineticClient_Get(Fixture.session, &getEntry, NULL); TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_DEVICE_LOCKED, status); } status = KineticAdminClient_UnlockDevice(Fixture.adminSession, NewPin); TEST_ASSERT_EQUAL_KineticStatus(KINETIC_STATUS_SUCCESS, status); Loading