#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <pthread.h>
#include <pwd.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include "afp.h"
#include "afpclient.h"
#include "afpcmd.h"
#include "afphelper.h"
#include "testhelper.h"
Data Structures | |
struct | async_io_req |
Functions | |
void | clean_exit (int exit_code) |
static int | cleanup_test_directory (CONN *conn, uint16_t volume, char *dirname) |
Clean up a test directory (main entry point) | |
int32_t | is_there (CONN *conn, uint16_t volume, int32_t did, char *name) |
int | delete_directory_tree (CONN *conn, uint16_t volume, uint32_t parent_did, char *dirname) |
depth-first recursively delete a directory tree | |
static void | starttimer (void) |
static void | stoptimer (void) |
static uint64_t | timediff (void) |
static void | format_padded_test_name (char *dest, const char *src, size_t width) |
static void | addresult (int32_t test, uint8_t iteration) |
static int32_t | should_skip_measurement (int32_t measure_type) |
static void | results_calc_stats (uint64_t averages[NUMTESTS][NUM_MEASUREMENTS], double std_devs[NUMTESTS][NUM_MEASUREMENTS], char tests_enabled[NUMTESTS]) |
static void | results_print_headers (bool is_csv) |
static void | results_print_row (int32_t test, bool is_csv, uint64_t averages[NUMTESTS][NUM_MEASUREMENTS], double std_devs[NUMTESTS][NUM_MEASUREMENTS]) |
static void | result_print_summary (uint64_t averages[NUMTESTS][NUM_MEASUREMENTS], bool is_csv, char tests_enabled[NUMTESTS]) |
static void | displayresults (void) |
static int32_t | safe_atoi (const char *str, const char *param_name, int32_t min_val, int32_t max_val) |
static void * | rply_thread (void *p) |
void | run_test (const int32_t dir) |
void | usage (char *av0) |
int | main (int32_t ac, char **av) |
Variables | |
bool | Debug = false |
bool | lantest_Quiet = false |
CONN * | Conn |
int | ExitCode = 0 |
int | Version = 34 |
int | Mac = 0 |
int | EmptyVol = 0 |
char | Data [300000] = "" |
char * | Vol = "" |
char * | User = "" |
char * | Path |
char * | Test = NULL |
static uint16_t | vol |
static DSI * | dsi |
static char * | Server = "localhost" |
static int32_t | Port = DSI_AFPOVERTCP_PORT |
static char * | Password = "" |
static uint8_t | Iterations = 2 |
static uint8_t | Iterations_save |
static uint8_t | iteration_counter = 0 |
static struct timeval | tv_start |
static struct timeval | tv_end |
static struct timeval | tv_dif |
static pthread_t | tid |
static bool | active_thread = false |
CONN * | Conn2 |
uint16_t | VolID |
int | PassCount = 0 |
int | FailCount = 0 |
int | SkipCount = 0 |
int | NotTestedCount = 0 |
char | FailedTests [1024][256] = {{0}} |
char | NotTestedTests [1024][256] = {{0}} |
char | SkippedTests [1024][256] = {{0}} |
static int32_t | smallfiles = 1000 |
static off_t | rwsize = 100 * 1024 * 1024 |
static int32_t | locking = 10000 / 40 |
static int32_t | create_enum_files = 2000 |
static int32_t | cache_dirs = 10 |
static int32_t | cache_files_per_dir = 10 |
static int32_t | cache_lookup_iterations = 100 |
static int32_t | mixed_cache_files = 200 |
static int32_t | deep_dir_levels = 20 |
static int32_t | deep_test_files = 50 |
static int32_t | deep_traversals = 50 |
static int32_t | validation_files = 100 |
static int32_t | validation_iterations = 100 |
static uint64_t | numrw |
static char | teststorun [NUMTESTS] |
static uint64_t(* | results )[][NUMTESTS][NUM_MEASUREMENTS] |
static char * | bigfilename |
static bool | csv_output = false |
static const char * | test_names [NUMTESTS] |
#define DIRNUM 10 /* 1000 nested dirs */ |
#define ERROR_CONFIGURATION 8 |
#define ERROR_FILE_DIRECTORY_OPS 3 |
#define ERROR_FORK_OPERATIONS 4 |
#define ERROR_LOGIN 10 |
#define ERROR_MEMORY_ALLOCATION 2 |
#define ERROR_NETWORK_PROTOCOL 5 |
#define ERROR_THREAD_OPERATIONS 6 |
#define ERROR_VALIDATION_TEST 7 |
#define ERROR_VOLUME_OPERATIONS 9 |
#define FPWRITE_RPLY_SIZE 24 |
#define FPWRITE_RQST_SIZE 36 |
#define LASTTEST TEST_CACHE_VALIDATION |
#define MEASURE_AFPD_READ_IO 1 |
#define MEASURE_AFPD_WRITE_IO 2 |
#define MEASURE_CNID_READ_IO 3 |
#define MEASURE_CNID_WRITE_IO 4 |
#define MEASURE_TIME_MS 0 |
#define NUM_MEASUREMENTS 5 |
#define NUMTESTS (LASTTEST+1) |
#define TEST_CACHE_HITS 8 |
#define TEST_CACHE_VALIDATION 11 |
#define TEST_CREATE2000FILES 4 |
#define TEST_DEEP_TRAVERSAL 10 |
#define TEST_DELETE2000FILES 6 |
#define TEST_DIRTREE 7 |
#define TEST_ENUM2000FILES 5 |
#define TEST_LOCKUNLOCK 3 |
#define TEST_MIXED_CACHE_OPS 9 |
#define TEST_NAME_DISPLAY_WIDTH 66 |
#define TEST_OPENSTATREAD 0 |
#define TEST_READ100MB 2 |
#define TEST_WRITE100MB 1 |
#define TOTAL_AFP_OPS 80686 |
|
static |
void clean_exit | ( | int | exit_code | ) |
|
static |
Clean up a test directory (main entry point)
conn | AFP connection |
volume | Volume ID |
dirname | Directory name to delete |
|
extern |
depth-first recursively delete a directory tree
Algorithm:
conn | AFP connection |
volume | Volume ID |
parent_did | Parent directory ID |
dirname | Directory name to delete |
|
static |
|
static |
int32_t is_there | ( | CONN * | conn, |
uint16_t | volume, | ||
int32_t | did, | ||
char * | name ) |
int main | ( | int32_t | ac, |
char ** | av ) |
|
static |
|
static |
|
static |
|
static |
|
static |
void run_test | ( | const int32_t | dir | ) |
|
static |
|
inlinestatic |
|
static |
|
static |
|
static |
void usage | ( | char * | av0 | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
CONN* Conn |
CONN* Conn2 |
|
static |
|
static |
char Data[300000] = "" |
bool Debug = false |
|
static |
|
static |
|
static |
|
static |
int EmptyVol = 0 |
int ExitCode = 0 |
int FailCount = 0 |
char FailedTests[1024][256] = {{0}} |
|
static |
|
static |
|
static |
bool lantest_Quiet = false |
|
static |
int Mac = 0 |
|
static |
int NotTestedCount = 0 |
char NotTestedTests[1024][256] = {{0}} |
|
static |
int PassCount = 0 |
|
static |
char* Path |
|
static |
|
static |
|
static |
|
static |
int SkipCount = 0 |
char SkippedTests[1024][256] = {{0}} |
|
static |
char* Test = NULL |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
char* User = "" |
|
static |
|
static |
int Version = 34 |
char* Vol = "" |
|
static |
uint16_t VolID |