test_storage: extend test harness; datastorage: two bug fixes

datastorage (bug fix): deleting expired array item would fail to test next item
test_storage: extended to cover all required datastorage entry points
test_storage: added ability to read script file
test_storage: added new and revised test scripts
TESTING.md: added to describe testing approach
general: added various TODO notes on things to come back to
general: revised #includes to make each "self-compiling"
general: revised #includes to minimise usage across source files
general: moved declarations and defintions to simplify and rationalise code
datastorage: refactor to support scalability testing
datastorage: made independent of time() calls to support testing
datastorage: fixed redundant use of both SORT_NUM and SORT_LENGTH defines
datastorage: fake kicking to test clients move between access points
msghandler: new module to reduce compile time interdependencies
mshhandler: (issue #100?) fixed SEGV memcpy() in dump_client() using strncpy()
ubus: merged uface into ubus
mac_utils: new module for MAC address utilites
test_header: added target to help #include rationalisation

Tested-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Ian Clowes 2020-05-27 19:25:04 +01:00 committed by Polynomialdivision
parent 0f63e00c43
commit 67c3ed0d0a
46 changed files with 2947 additions and 1476 deletions

View file

@ -1,14 +1,14 @@
#include <iwinfo.h>
#include <limits.h>
#include "mac_utils.h"
#include "datastorage.h"
#include "dawn_iwinfo.h"
#include <limits.h>
#include <iwinfo.h>
#include <dirent.h>
#include "utils.h"
#include "ubus.h"
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
char hostapd_dir_glob[HOSTAPD_DIR_LEN];
int call_iwinfo(char *client_addr);
int parse_rssi(char *iwinfo_string);
@ -271,7 +271,7 @@ int get_bssid(const char *ifname, uint8_t *bssid_addr) {
return 0;
}
int get_ssid(const char *ifname, char* ssid) {
int get_ssid(const char *ifname, char* ssid, size_t ssidmax) {
const struct iwinfo_ops *iw;
char buf[IWINFO_ESSID_MAX_SIZE+1] = { 0 };
if (strcmp(ifname, "global") == 0)
@ -280,7 +280,7 @@ int get_ssid(const char *ifname, char* ssid) {
if (iw->ssid(ifname, buf))
memset(buf, 0, sizeof(buf));
memcpy(ssid, buf, (SSID_MAX_LEN) * sizeof(char));
memcpy(ssid, buf, ssidmax);
strcpy(ssid, buf);
iwinfo_finish();
return 0;
@ -373,6 +373,7 @@ int support_vht(const char *ifname) {
return 0;
}
// TODO: 1 << 2 duplicated here, and also appears as HT mode mask
uint32_t vht_support_bitmask = (1 << 2) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6);
int ret = htmodes & vht_support_bitmask ? 1 : 0;
iwinfo_finish();