summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Carré2013-04-15 18:11:04 +0200
committerThierry Carré2013-04-26 17:06:12 +0200
commit723a84908f0f0571eef90361a98221d3055d00a6 (patch)
tree97aae2d993fbf72a30ed534758d918b2b0cca3d2
parent00a1bab05fa0fd3f5744be7624d2555bcb2d2e9d (diff)
cleo/devkit/tests/libspid/ftests: delete an obsolete unit test
-rw-r--r--cleopatre/devkit/tests/libspid/ftests/Makefile21
-rw-r--r--cleopatre/devkit/tests/libspid/ftests/src/spidlib_ftests.c313
-rw-r--r--cleopatre/devkit/tests/libspid/ftests/test.cnf13
3 files changed, 0 insertions, 347 deletions
diff --git a/cleopatre/devkit/tests/libspid/ftests/Makefile b/cleopatre/devkit/tests/libspid/ftests/Makefile
deleted file mode 100644
index 74db15cd9e..0000000000
--- a/cleopatre/devkit/tests/libspid/ftests/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-BASE = ../../../../../cesar
-CLEO_BASE = ../cleopatre
-
-# We test libspid.
-PROJECT_DIR = $(CLEO_BASE)/application/libspid
-
-LINUX_PATH = $(CLEO_BASE)/linux-2.6.25.10-spc300
-
-INCLUDES = $(PROJECT_DIR)/inc $(CLEO_BASE)/include
-
-TARGET_PROGRAMS = libspid_ftest
-
-TARGET = arm
-
-libspid_ftest_SOURCES = spidlib_ftests.c
-libspid_ftest_MODULES = $(CLEO_BASE)/application/libspid
-
-EXTRA_TARGET_LDFLAGS = -static
-DEFS = -DLINUX
-
-include $(BASE)/common/make/top.mk
diff --git a/cleopatre/devkit/tests/libspid/ftests/src/spidlib_ftests.c b/cleopatre/devkit/tests/libspid/ftests/src/spidlib_ftests.c
deleted file mode 100644
index 0ec2d4ef6c..0000000000
--- a/cleopatre/devkit/tests/libspid/ftests/src/spidlib_ftests.c
+++ /dev/null
@@ -1,313 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include "libspid.h"
-#include "nvram.h"
-#include "spid_img_desc.h"
-
-#define CNF_FILE_NAME "test.cnf"
-#define LABEL "ethernet"
-#define NEW_VALUE "01:ab:02:cd:03:ef"
-#define BUFF_LEN 4096
-#define ELT_NUMBER 16
-
-int main()
-{
- char filename[] = CNF_FILE_NAME;
- char label[] = LABEL;
- char value[BUFF_LEN];
- int buffer_len;
- const char* delimiters = "= \t";
- char key[LIBSPID_CONFIG_KEY_MAX_LEN];
- char *elt[ELT_NUMBER];
- unsigned int elt_number = sizeof(elt)/sizeof(elt[0]);
- char buffer[BUFF_LEN];
- int i = 0;
- int rc = 0;
- char *elt0 = "One";
- char *elt1 = "Two";
- char *elt2 = "Three";
- unsigned int total_s;
- unsigned int idle_s;
- spidcom_nvram_t nvram;
- libspid_ip_t ip;
- unsigned char mac[32];
- char mtd_name[32];
- spidcom_image_desc_t image_desc;
- spidcom_image_desc_t *id = &image_desc;
-
-#if 0
-
- /*
- * --- config_item.c ---
- */
- buffer_len = sizeof(value)/sizeof(value[0]);
- libspid_config_read_item (filename, label, value, buffer_len);
- printf("*** libspid_config_read_item ***\n");
- printf("read value : %s\n", value);
-
- printf("\n");
-
- printf("*** libspid_config_write_item ***\n");
- memset (value, '3', 1022);
- value[1023] = '\0';
- if ( LIBSPID_SUCCESS == ( rc = libspid_config_write_item(filename, label, value) ) )
- {
- printf("gpio815 was set to : %s\n", value);
- }
- else
- {
- printf("Error %d in libspid_config_write_item()\n", rc);
- }
-
- strcpy(label, "gpio815");
- strcpy(value, "0x777 <--- WE CHANGED IT!");
- if ( LIBSPID_SUCCESS == ( rc = libspid_config_write_item(filename, label, value) ) )
- {
- }
- else
- {
- printf("Error %d in libspid_config_write_item()\n", rc);
- }
-
- /*
- * --- config_line.c ---
- */
- buffer_len = sizeof(buffer)/sizeof(buffer[0]);
- strcpy(key, "gpio815");
- if ( LIBSPID_SUCCESS == (rc = libspid_config_read_line(filename, delimiters, key, &elt_number, elt, buffer, buffer_len) ) )
- {
- printf("Elements read from line:\n");
- for (i=0; i<elt_number; i++)
- {
- printf ("\telement %d : %s\n", i, elt[i]);
- }
- }
- else
- {
- printf ("ERROR %d in libspid_config_read_line()\n", rc);
- }
-
- elt[0] = elt0;
- elt[1] = elt1;
- elt[2] = elt2;
- if ( LIBSPID_SUCCESS == (rc = libspid_config_write_line(filename, '@', "ethernet", 3, elt) ) )
- {
- }
- else
- {
- printf ("ERROR %d in libspid_config_write_line()\n", rc);
- }
-
-
-
- if ( LIBSPID_SUCCESS == (rc = libspid_config_remove_line(filename, "= \t", "phy") ) )
- {
- }
- else
- {
- printf ("ERROR %d in libspid_config_remove_line()\n", rc);
- }
-
- /*
- * --- system.c ---
- */
- buffer[0] = '\0';
- buffer_len = sizeof(buffer)/sizeof(buffer[0]);
- if ( LIBSPID_SUCCESS == (rc = libspid_system_get_kernel_version(buffer, buffer_len) ) )
- {
- printf("----------\n");
-
- printf("Original system version : \n");
- system("cat /proc/version");
-
- printf("Retreived version string : \n");
- printf("%s", buffer);
- }
- else
- {
- printf ("ERROR %d in libspid_system_get_kernel_version()\n", rc);
- }
-
-
-
- if ( LIBSPID_SUCCESS == (rc = libspid_system_get_uptime(&total_s, &idle_s) ) )
- {
- printf("----------\n");
-
- printf("Original system timings : \n");
- system("cat /proc/uptime");
-
- printf("Retreived timings : \n");
- printf("total_s = %d, idle_s = %d\n", total_s, idle_s);
- }
- else
- {
- printf ("ERROR %d in libspid_system_get_uptime()\n", rc);
- }
-
-
- buffer[0] = '\0';
- buffer_len = sizeof(buffer)/sizeof(buffer[0]);
- if ( LIBSPID_SUCCESS == (rc = libspid_system_get_meminfo(buffer, buffer_len) ) )
- {
- printf("----------\n");
-
- printf("Original mem info : \n");
- system("cat /proc/meminfo");
-
- printf("\nRetreived version string : \n");
- printf("%s", buffer);
- }
- else
- {
- printf ("ERROR %d in libspid_system_get_meminfo()\n", rc);
- }
-
- if ( LIBSPID_SUCCESS == (rc = libspid_system_save() ) )
- {
- printf("\nConfiguration saved successfully.\n");
- }
- else
- {
- printf ("ERROR %d in libspid_system_save()\n", rc);
- }
-
-
-
- if ( LIBSPID_SUCCESS == (rc = libspid_system_get_nvram(&nvram) ) )
- {
- int i;
-
- printf("\nSome fields of read NVRAM :\n");
- printf("nvram.pkg_cfg = %#x\n", nvram.pkg_cfg);
- printf("nvram.sdram_config = %#x\n", nvram.sdram_config);
- printf("nvram.nb_images = %d\n", nvram.nb_images);
-
- printf("nvram.eth1_address = ");
- for (i=0; i<6; i++)
- printf("%#x ", nvram.eth1_address[i]);
- printf("\n");
- }
- else
- {
- printf ("ERROR %d in libspid_system_get_nvram()\n", rc);
- }
-
- /*
- * --- network.c ---
- */
-
- if ( LIBSPID_SUCCESS == (rc = libspid_network_get_ip("eth0", &ip) ) )
- {
- printf("\nGot this configuration :\n");
- printf("mode=%d\n", ip.mode);
- printf("address=%s\n", ip.address);
- printf("netmask=%s\n", ip.netmask);
- printf("broadcast=%s\n", ip.broadcast);
- printf("gateway=%s\n", ip.gateway);
- }
- else
- {
- printf ("ERROR %d in libspid_network_get_ip()\n", rc);
- }
-
- ip.mode = LIBSPID_IP_MODE_DHCP;
- strcpy(ip.address, "123.45.678.9");
- strcpy(ip.netmask, "44.444.5.555");
- strcpy(ip.broadcast, "987.6.54.321");
- strcpy(ip.gateway, "01.01.10.10");
-
- if ( LIBSPID_SUCCESS == (rc = libspid_network_set_ip("eth0", &ip) ) )
- {
- printf("\nSet this configuration :\n");
- printf("mode=%d\n", ip.mode);
- printf("address=%s\n", ip.address);
- printf("netmask=%s\n", ip.netmask);
- printf("broadcast=%s\n", ip.broadcast);
- printf("gateway=%s\n", ip.gateway);
- }
- else
- {
- printf ("ERROR %d in libspid_network_set_ip()\n", rc);
- }
-
- if ( LIBSPID_SUCCESS == (rc = libspid_network_get_mac("eth0", mac) ) )
- {
- printf("\nFound MAC addr=%s\n", mac);
- }
- else
- {
- printf ("ERROR %d in libspid_network_get_mac()\n", rc);
- }
-
-#endif
-
-
- /*
- * --- image.c ---
- */
- if ( LIBSPID_SUCCESS == (rc = libspid_image_get_desc(LIBSPID_IMAGE_DESC_TYPE_CURRENT, id, mtd_name) ) )
- {
- int i;
-
- printf("mtd_name=%s\n", mtd_name);
-
- printf("id->magic=");
- fwrite ( id->magic, 8, 1, stdout );
- printf("\n");
-
- printf("index=%d\n", id->index);
- printf("is_1st_boot=%d\n", id->is_1st_boot);
-
- printf("id->md5_sum=");
- for(i=0; i<16; i++)
- {
- printf("%2.2x", id->md5_sum[i]);
- }
- printf("\n");
- }
- else
- {
- printf ("ERROR %d in libspid_image_get_desc()\n", rc);
- }
-
- if ( LIBSPID_SUCCESS == (rc = libspid_image_get_desc(LIBSPID_IMAGE_DESC_TYPE_ALTERNATE, id, mtd_name) ) )
- {
- int i;
-
- printf("mtd_name=%s\n", mtd_name);
-
- printf("id->magic=");
- fwrite ( id->magic, 8, 1, stdout );
- printf("\n");
-
- printf("index=%d\n", id->index);
- printf("is_1st_boot=%d\n", id->is_1st_boot);
-
- printf("id->md5_sum=");
- for(i=0; i<16; i++)
- {
- printf("%2.2x", id->md5_sum[i]);
- }
- printf("\n");
- }
- else
- {
- printf ("ERROR %d in libspid_image_get_desc()\n", rc);
- }
-
- if ( LIBSPID_SUCCESS == (rc = libspid_image_select(LIBSPID_IMAGE_SELECT_SWITCH) ) )
- {
- printf("Active image switched.\n");
- }
- else
- {
- printf ("ERROR %d in libspid_image_get_desc()\n", rc);
- }
-
- return 0;
-}
diff --git a/cleopatre/devkit/tests/libspid/ftests/test.cnf b/cleopatre/devkit/tests/libspid/ftests/test.cnf
deleted file mode 100644
index dbae518c6e..0000000000
--- a/cleopatre/devkit/tests/libspid/ftests/test.cnf
+++ /dev/null
@@ -1,13 +0,0 @@
- pkgcfg =0x20c
-gpio07=0x0
- gpio815= 0x0
-# sconr =0x1c3168
-stmg0r =0x22a569a
-stmg1r= 0x70008
- srefr=0x927
-#forg=0x7
-#img0off=0x140000
-phy=0x0
- ethernet = 00:50:c2:38:00:0B
-nbimg=2
-