Remove files no longer in use
testaddsel.cpp and testit.cpp have not been compiled and are no
longer in use. This patch will remove these two files.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I14f23a6b0663347a8c7957445da6c6f1a6091365
diff --git a/testaddsel.cpp b/testaddsel.cpp
deleted file mode 100644
index 9269afb..0000000
--- a/testaddsel.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-#include "sensorhandler.hpp"
-
-#include <errno.h>
-#include <limits.h>
-#include <mapper.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <systemd/sd-bus.h>
-
-extern void send_esel(uint16_t recordid);
-
-sd_bus* bus = NULL;
-
-// Use a lookup table to find the interface name of a specific sensor
-// This will be used until an alternative is found. this is the first
-// step for mapping IPMI
-int find_openbmc_path(const uint8_t num, dbus_interface_t* interface)
-{
- const char* objname = "/org/openbmc/managers/System";
-
- char *str1, *str2, *str3;
- sd_bus_error error = SD_BUS_ERROR_NULL;
- sd_bus_message *reply = NULL, *m = NULL;
- int r;
- char* busname = NULL;
-
- r = mapper_get_service(bus, objname, &busname);
- if (r < 0)
- {
- log<level::ERR>("Failed to get busname", entry("BUS=%s", objname),
- entry("ERRNO=0x%X", -r));
- goto final;
- }
-
- r = sd_bus_message_new_method_call(bus, &m, busname, objname, busname,
- "getObjectFromByteId");
- if (r < 0)
- {
- log<level::ERR>("Failed to create a method call",
- entry("ERRNO=0x%X", -r));
- }
-
- r = sd_bus_message_append(m, "sy", type, num);
- if (r < 0)
- {
- log<level::ERR>("Failed to create a input parameter",
- entry("ERRNO=0x%X", -r));
- }
-
- // Call the IPMI responder on the bus so the message can be sent to the CEC
- r = sd_bus_call(bus, m, 0, &error, &reply);
- if (r < 0)
- {
- log<level::ERR>("Failed to call the method", entry("ERRNO=0x%X", -r));
- goto final;
- }
-
- r = sd_bus_message_read(reply, "(sss)", &str1, &str2, &str3);
- if (r < 0)
- {
- log<level::ERR>("Failed to get a response", entry("ERRNO=0x%X", -r));
- goto final;
- }
-
- strncpy(interface->bus, str1, MAX_DBUS_PATH);
- strncpy(interface->path, str2, MAX_DBUS_PATH);
- strncpy(interface->interface, str3, MAX_DBUS_PATH);
-
- interface->sensornumber = num;
-
-final:
-
- sd_bus_error_free(&error);
- sd_bus_message_unref(m);
- free(busname);
-
- return r;
-}
-
-int main(int argc, char* argv[])
-{
- int base;
- char *endptr, *str;
- long val;
- uint16_t num;
- int r;
-
- if (argc < 2)
- {
- fprintf(stderr, "Usage: %s sensornumber\n", argv[0]);
- return -1;
- }
-
- str = argv[1];
- base = (argc > 2) ? atoi(argv[2]) : 10;
-
- val = strtol(str, &endptr, base);
-
- num = (uint16_t)val;
-
- /* Connect to system bus */
- r = sd_bus_open_system(&bus);
- if (r < 0)
- {
- log<level::ERR>("Failed to connect to system bus",
- entry("ERRNO=0x%X", -r));
- goto finish;
- }
-
- send_esel(num);
-
-finish:
- sd_bus_unref(bus);
-
- return 0;
-}
diff --git a/testit.cpp b/testit.cpp
deleted file mode 100644
index 0a703ab..0000000
--- a/testit.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-unsigned char g_sensortype[][2] = {
- {0xC3, 0x01}, {0x07, 0x02}, {0x0F, 0x05}, {0x0c, 0x1F}, {0xFF, 0xff}};
-
-uint8_t find_type_for_sensor_number(uint8_t sensor_number)
-{
- int i = 0;
- uint8_t rc;
-
- while (g_sensortype[i][0] != 0xff)
- {
- if (g_sensortype[i][1] == sensor_number)
- {
- break;
- }
- else
- {
- i++;
- }
- }
-
- rc = g_sensortype[i][0];
-
- if (rc == 0xFF)
- {
- rc = 0;
- }
- return rc;
-}
-
-char g_results_method[64];
-char g_results_value[64];
-
-int set_sensor_dbus_state_s(unsigned char number, const char* member,
- const char* value)
-{
- strcpy(g_results_method, member);
- strcpy(g_results_value, value);
-
- return 0;
-}
-
-int set_sensor_dbus_state_y(unsigned char number, const char* member,
- uint8_t value)
-{
- char val[2];
-
- snprintf(val, 2, "%d", value);
-
- strcpy(g_results_method, member);
- strcpy(g_results_value, val);
-
- return 0;
-}
-
-extern int updateSensorRecordFromSSRAESC(const void* record);
-
-// DIMM Present
-uint8_t testrec_sensor1[] = {0x1F, 0xa9, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00};
-
-// DIMM Not present
-uint8_t testrec_sensor2[] = {0x1F, 0xa9, 0x00, 0x00, 0x00,
- 0x40, 0x00, 0x00, 0x00, 0x00};
-
-// DIMM Not present
-uint8_t testrec_procfailed[] = {0x02, 0xa9, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x00, 0x00, 0x00};
-
-// Virtual Sensor 5, setting a Value of 0h
-uint8_t testrec_bootprogress[] = {0x05, 0xa9, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x0E, 0x00};
-
-// Virtual Sensor setting a boot count
-uint8_t testrec_bootcount[] = {0x01, 0x09, 0x00, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00};
-
-// Invalid sensor number
-uint8_t testrec_invalidnumber[] = {0x35, 0xa9, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x03, 0x00};
-
-int check_results(int rc, const char* method, const char* value)
-{
- if (strcmp(g_results_method, method))
- {
- log<level::ERR>("Method Failed", entry("EXPECT=%s", method),
- entry("GOT=%s", g_results_method));
- return -1;
- }
- if (strcmp(g_results_value, value))
- {
- log<level::ERR>("Value failed", entry("EXPECT=%s", value),
- entry("GOT=%s", g_results_method));
- return -2;
- }
-
- return 0;
-}
-
-void testprep(void)
-{
- memset(g_results_method, 0, sizeof(g_results_method));
- memset(g_results_value, 0, sizeof(g_results_value));
-}
-
-int main()
-{
- testprep();
- check_results(updateSensorRecordFromSSRAESC(testrec_bootprogress),
- "setValue", "FW Progress, Docking station attachment");
- testprep();
- check_results(updateSensorRecordFromSSRAESC(testrec_sensor1), "setPresent",
- "True");
- testprep();
- check_results(updateSensorRecordFromSSRAESC(testrec_sensor2), "setPresent",
- "False");
- testprep();
- check_results(updateSensorRecordFromSSRAESC(testrec_procfailed), "setFault",
- "False");
- testprep();
- check_results(updateSensorRecordFromSSRAESC(testrec_bootcount), "setValue",
- "3");
- testprep();
- check_results(updateSensorRecordFromSSRAESC(testrec_invalidnumber), "", "");
-
- return 0;
-}