Commit dff5c126 authored by Greg Williams's avatar Greg Williams
Browse files

Implemted instant secure erase and refactored system, utility tests to simply...

Implemted instant secure erase and refactored system, utility tests to simply call ISE as part of test setup
parent 5621fc47
Loading
Loading
Loading
Loading
+3 −23
Original line number Diff line number Diff line
@@ -235,13 +235,6 @@ start_simulator:
	sleep 3
	@echo STARTED SIMULATOR!!!

erase_simulator: start_simulator
	@echo ERASING SIMULATOR...
	sleep 1
	./vendor/kinetic-simulator/eraseSimulator.sh
	sleep 1
	@echo ERASED SIMULATOR!!!

stop_simulator:
	@echo STOPPING SIMULATOR...
	sleep 1
@@ -249,8 +242,6 @@ stop_simulator:
	sleep 1
	@echo STOPPED SIMULATOR!!!

.PHONY: erase_simulator


#===============================================================================
# Test Utility Build Support
@@ -286,14 +277,12 @@ SIM_RUNNER = com.seagate.kinetic.simulator.internal.SimulatorRunner
SIM_ADMIN = com.seagate.kinetic.admin.cli.KineticAdminCLI

run: $(UTIL_EXEC) start_simulator
	sleep 1
	./vendor/kinetic-simulator/eraseSimulator.sh &> /dev/null;
	sleep 1
	@echo
	@echo --------------------------------------------------------------------------------
	@echo Running test utility: $(UTIL_EXEC)
	@echo --------------------------------------------------------------------------------
	@echo
	$(UTIL_EXEC) instanterase
	$(UTIL_EXEC) noop
	exec $(UTIL_EXEC) put get delete
	@echo
@@ -315,12 +304,9 @@ list_examples:
	echo $(example_executables)

$(BIN_DIR)/examples/%: $(EXAMPLE_SRC)/%.c $(KINETIC_LIB)
	sleep 1
	./vendor/kinetic-simulator/eraseSimulator.sh &> /dev/null;
	sleep 1
	@echo
	@echo ================================================================================
	@echo Building example: $<
	@echo Building example: '$<'
	@echo --------------------------------------------------------------------------------
	$(CC) -o $@ $< $(CFLAGS) -I$(PUB_INC) $(UTIL_LDFLAGS) $(KINETIC_LIB)
	@echo ================================================================================
@@ -329,7 +315,6 @@ $(BIN_DIR)/examples/%: $(EXAMPLE_SRC)/%.c $(KINETIC_LIB)
build_examples: $(example_executables)

test_example_%: $(BIN_DIR)/examples/%
	sleep 1
	@echo
	@echo ================================================================================
	@echo Executing example: '$<'
@@ -337,14 +322,9 @@ test_example_%: $(BIN_DIR)/examples/%
	$<
	@echo ================================================================================
	@echo

test_example_%: start_simulator erase_simulator
test_example_%: start_simulator

run_example_%: $(BIN_DIR)/examples/%
run_example_%: $(BIN_DIR)/examples/%
	sleep 1
	./vendor/kinetic-simulator/eraseSimulator.sh &> /dev/null;
	sleep 1
	@echo
	@echo ================================================================================
	@echo Executing example: '$<'
+1 −7
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ Dir['test/integration/test_*.c'].each do |test_file|
  task test_file => ['java_sim:shutdown', 'ruby_sim:start']
end
Dir['test/system/test_*.c'].each do |test_file|
  task test_file => ['ruby_sim:shutdown', 'java_sim:erase', 'java_sim:start']
  task test_file => ['ruby_sim:shutdown', 'java_sim:start']
end

namespace :system do
@@ -295,7 +295,6 @@ namespace :tests do
  task :system => ['java_sim:start'] do
    report_banner "Running System Tests"
    shutdown_ruby_server
    java_sim_erase_drive
    java_sim_start
    Rake::Task['test:path'].reenable
    Rake::Task['test:path'].invoke('test/system')
@@ -308,7 +307,6 @@ namespace :tests do
      desc "Run system test #{basename}"
      task basename do
        shutdown_ruby_server
        java_sim_erase_drive
        java_sim_start
        Rake::Task[test].reenable
        Rake::Task[test].invoke
@@ -333,7 +331,6 @@ namespace :tests do
    end

    task :noop => ['ruby_sim:shutdown'] do
      java_sim_erase_drive
      with_test_server("Testing NoOp Operation") do
        execute_command "./kinetic-c noop"
        execute_command "./kinetic-c --host localhost noop"
@@ -343,14 +340,12 @@ namespace :tests do
    end

    task :put => ['ruby_sim:shutdown'] do
      java_sim_erase_drive
      with_test_server("Testing Put operation") do
        execute_command "./kinetic-c put"
      end
    end

    task :get => ['ruby_sim:shutdown'] do
      java_sim_erase_drive
      with_test_server("Testing Get operation") do
        execute_command "./kinetic-c put"
        execute_command "./kinetic-c get"
@@ -359,7 +354,6 @@ namespace :tests do
    end

    task :delete => ['release', 'ruby_sim:shutdown'] do
      java_sim_erase_drive
      with_test_server("Testing Get operation") do
        execute_command "./kinetic-c put"
        execute_command "./kinetic-c get"
+9 −0
Original line number Diff line number Diff line
@@ -161,4 +161,13 @@ KineticStatus KineticClient_GetLog(KineticSessionHandle handle,
                                   KineticDeviceInfo** info,
                                   KineticCompletionClosure* closure);

/**
 * @brief Executes an InstantSecureErase command to erase all data from the Kinetic device.
 *
 * @param handle        KineticSessionHandle for a connected session.
 *
 * @return              Returns the resulting KineticStatus
 */
KineticStatus KineticClient_InstantSecureErase(KineticSessionHandle handle);

#endif // _KINETIC_CLIENT_H
+11 −0
Original line number Diff line number Diff line
@@ -211,3 +211,14 @@ KineticStatus KineticClient_GetLog(KineticSessionHandle handle,
    // Execute the operation
    return KineticController_ExecuteOperation(operation, closure);
}

KineticStatus KineticClient_InstantSecureErase(KineticSessionHandle handle)
{
    assert(handle != KINETIC_HANDLE_INVALID);

    KineticOperation* operation = KineticController_CreateOperation(handle);
    if (operation == NULL) {return KINETIC_STATUS_MEMORY_ERROR;}

    KineticOperation_BuildInstantSecureErase(operation);
    return KineticController_ExecuteOperation(operation, NULL);
}
+12 −0
Original line number Diff line number Diff line
@@ -625,6 +625,18 @@ void KineticLogger_LogProtobuf(int log_level, const KineticProto_Message* msg)
                #endif
                }

                if (cmd->body->pinOp) {
                    LOG_PROTO_LEVEL_START("pinOp");
                    {
                        if (cmd->body->pinOp->has_pinOpType) {
                            const ProtobufCEnumValue* eVal = protobuf_c_enum_descriptor_get_value(
                                                                 &KineticProto_command_pin_operation_pin_op_type__descriptor,
                                                                 cmd->body->pinOp->pinOpType);
                            KineticLogger_LogPrintf(log_level, "%spinOpType: %s", _indent, eVal->name);
                        }
                    }
                    LOG_PROTO_LEVEL_END();
                }

                // Get Log
                //
Loading