From f3618dcbcff8ae6b2eabf982f4c4fbbc3dd66703 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 4 Jun 2015 07:43:24 -0700 Subject: [PATCH] app: fix whitespace Fix trailing whitespace, space before tab and empty lines at end of file. Signed-off-by: Stephen Hemminger [Thomas: fix indent and alignment in test_acl.h and test_sched.c] --- app/cmdline_test/cmdline_test.py | 3 +- app/cmdline_test/cmdline_test_data.py | 1 - app/test-pmd/csumonly.c | 1 - app/test-pmd/mempool_anon.c | 4 +-- app/test-pmd/testpmd.c | 8 +++--- app/test/autotest.py | 1 - app/test/autotest_data.py | 28 +++++++++--------- app/test/autotest_runner.py | 41 +++++++++++++-------------- app/test/autotest_test_funcs.py | 1 - app/test/process.h | 12 ++++---- app/test/test_acl.h | 18 ++++++------ app/test/test_sched.c | 8 +++--- 12 files changed, 60 insertions(+), 66 deletions(-) diff --git a/app/cmdline_test/cmdline_test.py b/app/cmdline_test/cmdline_test.py index 5d7c7be5d6..8efc5ead44 100755 --- a/app/cmdline_test/cmdline_test.py +++ b/app/cmdline_test/cmdline_test.py @@ -67,7 +67,7 @@ def runHistoryTest(child): while i < history_size / 10: # add 1 to prevent from parsing as octals child.send("1" + str(i).zfill(8) + cmdline_test_data.ENTER) - # the app will simply print out the number + # the app will simply print out the number child.expect(str(i + 100000000), timeout=1) i += 1 # scroll back history @@ -111,4 +111,3 @@ except: sys.exit(1) child.close() sys.exit(0) - diff --git a/app/cmdline_test/cmdline_test_data.py b/app/cmdline_test/cmdline_test_data.py index a5d8dd9c0f..b1945a579f 100644 --- a/app/cmdline_test/cmdline_test_data.py +++ b/app/cmdline_test/cmdline_test_data.py @@ -309,4 +309,3 @@ tests = [ "Sequence" : CTRL_D*3, "Result" : None}, ] - diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index c180ff28fd..950ea82a1d 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -706,4 +706,3 @@ struct fwd_engine csum_fwd_engine = { .port_fwd_end = NULL, .packet_fwd = pkt_burst_checksum_forward, }; - diff --git a/app/test-pmd/mempool_anon.c b/app/test-pmd/mempool_anon.c index 559a6252a0..69bbef377b 100644 --- a/app/test-pmd/mempool_anon.c +++ b/app/test-pmd/mempool_anon.c @@ -130,8 +130,8 @@ mempool_anon_create(const char *name, unsigned elt_num, unsigned elt_size, (rc = get_phys_map(va, pa, pg_num, pg_sz)) == 0) { /* - * Check that allocated size is big enough to hold elt_num - * objects and a calcualte how many bytes are actually required. + * Check that allocated size is big enough to hold elt_num + * objects and a calcualte how many bytes are actually required. */ if ((usz = rte_mempool_xmem_usage(va, elt_num, total_size, pa, diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 83a3d74a1b..82b465df76 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1822,10 +1822,10 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) { uint8_t i; - /* - * Builds up the correct configuration for dcb+vt based on the vlan tags array - * given above, and the number of traffic classes available for use. - */ + /* + * Builds up the correct configuration for dcb+vt based on the vlan tags array + * given above, and the number of traffic classes available for use. + */ if (dcb_conf->dcb_mode == DCB_VT_ENABLED) { struct rte_eth_vmdq_dcb_conf vmdq_rx_conf; struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf; diff --git a/app/test/autotest.py b/app/test/autotest.py index a79db1069b..5d6adb6fec 100644 --- a/app/test/autotest.py +++ b/app/test/autotest.py @@ -73,4 +73,3 @@ for test_group in autotest_data.non_parallel_test_group_list: runner.add_non_parallel_test_group(test_group) runner.run_all_tests() - diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py index 618a9467d5..02921ff2c5 100644 --- a/app/test/autotest_data.py +++ b/app/test/autotest_data.py @@ -56,7 +56,7 @@ parallel_test_group_list = [ { "Prefix": "group_1", "Memory" : all_sockets(8), - "Tests" : + "Tests" : [ { "Name" : "Timer autotest", @@ -69,7 +69,7 @@ parallel_test_group_list = [ "Command" : "debug_autotest", "Func" : default_autotest, "Report" : None, - }, + }, { "Name" : "Errno autotest", "Command" : "errno_autotest", @@ -87,7 +87,7 @@ parallel_test_group_list = [ "Command" : "common_autotest", "Func" : default_autotest, "Report" : None, - }, + }, { "Name" : "Dump log history", "Command" : "dump_log_history", @@ -111,7 +111,7 @@ parallel_test_group_list = [ { "Prefix": "group_2", "Memory" : "32", - "Tests" : + "Tests" : [ { "Name" : "Memory autotest", @@ -166,7 +166,7 @@ parallel_test_group_list = [ { "Prefix": "group_3", "Memory" : all_sockets(1024), - "Tests" : + "Tests" : [ { "Name" : "LPM autotest", @@ -209,7 +209,7 @@ parallel_test_group_list = [ { "Prefix": "group_4", "Memory" : all_sockets(128), - "Tests" : + "Tests" : [ { "Name" : "PCI autotest", @@ -252,7 +252,7 @@ parallel_test_group_list = [ { "Prefix": "group_5", "Memory" : "16", - "Tests" : + "Tests" : [ { "Name" : "Spinlock autotest", @@ -289,7 +289,7 @@ parallel_test_group_list = [ { "Prefix": "group_6", "Memory" : all_sockets(620), - "Tests" : + "Tests" : [ { "Name" : "Function reentrancy autotest", @@ -369,7 +369,7 @@ non_parallel_test_group_list = [ { "Prefix": "mempool_perf", "Memory" : all_sockets(256), - "Tests" : + "Tests" : [ { "Name" : "Cycles autotest", @@ -388,7 +388,7 @@ non_parallel_test_group_list = [ { "Prefix": "memcpy_perf", "Memory" : all_sockets(512), - "Tests" : + "Tests" : [ { "Name" : "Memcpy performance autotest", @@ -401,7 +401,7 @@ non_parallel_test_group_list = [ { "Prefix": "hash_perf", "Memory" : all_sockets(512), - "Tests" : + "Tests" : [ { "Name" : "Hash performance autotest", @@ -466,7 +466,7 @@ non_parallel_test_group_list = [ { "Prefix": "timer_perf", "Memory" : all_sockets(512), - "Tests" : + "Tests" : [ { "Name" : "Timer performance autotest", @@ -476,14 +476,14 @@ non_parallel_test_group_list = [ }, ] }, - + # # Please always make sure that ring_perf is the last test! # { "Prefix": "ring_perf", "Memory" : all_sockets(512), - "Tests" : + "Tests" : [ { "Name" : "Ring performance autotest", diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index 260b72ca88..7d28707f95 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -154,7 +154,7 @@ def run_test_group(cmdline, test_group): results.append(result) # regardless of whether test has crashed, try quitting it - try: + try: child.sendline("quit") child.close() # if the test crashed, just do nothing instead @@ -198,7 +198,7 @@ class AutotestRunner: self.logfile = open(logfile, "w") csvfile = open(csvfile, "w") self.csvwriter = csv.writer(csvfile) - + # prepare results table self.csvwriter.writerow(["test_name","test_result","result_str"]) @@ -230,12 +230,12 @@ class AutotestRunner: def add_non_parallel_test_group(self,test_group): self.non_parallel_test_groups.append(test_group) - - + + def __process_results(self, results): # this iterates over individual test results for i, result in enumerate(results): - + # increase total number of tests that were run # do not include "start" test if i > 0: @@ -263,10 +263,10 @@ class AutotestRunner: # if test failed and it wasn't a "start" test if test_result < 0 and not i == 0: self.fails += 1 - + # collect logs self.log_buffers.append(log) - + # create report if it exists if report: try: @@ -276,7 +276,7 @@ class AutotestRunner: else: with f: f.write(report) - + # write test result to CSV file if i != 0: self.csvwriter.writerow([test_name, test_result, result_str]) @@ -299,7 +299,7 @@ class AutotestRunner: # dump tests are specified in full e.g. "Dump_mempool" if "_autotest" in test_id: test_id = test_id[:-len("_autotest")] - + # filter out blacklisted/whitelisted tests if self.blacklist and test_id in self.blacklist: test_group["Tests"].remove(test) @@ -316,13 +316,13 @@ class AutotestRunner: # put the numbers backwards so that we start # deleting from the end, not from the beginning groups_to_remove.insert(0, i) - + # remove test groups that need to be removed for i in groups_to_remove: del test_groups[i] - + return test_groups - + # iterate over test groups and run tests associated with them @@ -332,12 +332,12 @@ class AutotestRunner: self.__filter_groups(self.parallel_test_groups) self.non_parallel_test_groups = \ self.__filter_groups(self.non_parallel_test_groups) - + # create a pool of worker threads pool = multiprocessing.Pool(processes=1) - + results = [] - + # whatever happens, try to save as much logs as possible try: @@ -370,7 +370,7 @@ class AutotestRunner: continue res = group_result.get() - + self.__process_results(res) # remove result from results list once we're done with it @@ -379,11 +379,11 @@ class AutotestRunner: # run non_parallel tests. they are run one by one, synchronously for test_group in self.non_parallel_test_groups: group_result = run_test_group(self.__get_cmdline(test_group), test_group) - + self.__process_results(group_result) - + # get total run time - cur_time = time.time() + cur_time = time.time() total_time = int(cur_time - self.start) # print out summary @@ -404,6 +404,5 @@ class AutotestRunner: # drop logs from all executions to a logfile for buf in self.log_buffers: self.logfile.write(buf.replace("\r","")) - - log_buffers = [] + log_buffers = [] diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py index b07064430f..0f012f6b75 100644 --- a/app/test/autotest_test_funcs.py +++ b/app/test/autotest_test_funcs.py @@ -295,4 +295,3 @@ def ring_autotest(child, test_name): return -1, "Fail [Bad watermark]" return 0, "Success" - diff --git a/app/test/process.h b/app/test/process.h index 057ba9f7fa..4f8d121162 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -67,14 +67,14 @@ process_dup(const char *const argv[], int numargs, const char *env_value) /* make a copy of the arguments to be passed to exec */ for (i = 0; i < numargs; i++) argv_cpy[i] = strdup(argv[i]); - #ifdef RTE_LIBRTE_XEN_DOM0 - argv_cpy[i] = strdup("--xen-dom0"); - argv_cpy[i + 1] = NULL; +#ifdef RTE_LIBRTE_XEN_DOM0 + argv_cpy[i] = strdup("--xen-dom0"); + argv_cpy[i + 1] = NULL; num = numargs + 1; - #else +#else argv_cpy[i] = NULL; num = numargs; - #endif +#endif /* close all open file descriptors, check /proc/self/fd to only * call close on open fds. Exclude fds 0, 1 and 2*/ @@ -96,7 +96,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value) } /* parent process does a wait */ while (wait(&status) != pid) - ; + ; return status; } diff --git a/app/test/test_acl.h b/app/test/test_acl.h index 4af457dfad..ac24ad8807 100644 --- a/app/test/test_acl.h +++ b/app/test/test_acl.h @@ -35,15 +35,15 @@ #define TEST_ACL_H_ struct ipv4_7tuple { - uint16_t vlan; - uint16_t domain; - uint8_t proto; - uint32_t ip_src; - uint32_t ip_dst; - uint16_t port_src; - uint16_t port_dst; - uint32_t allow; - uint32_t deny; + uint16_t vlan; + uint16_t domain; + uint8_t proto; + uint32_t ip_src; + uint32_t ip_dst; + uint16_t port_src; + uint16_t port_dst; + uint32_t allow; + uint32_t deny; }; /* rules for invalid layout test */ diff --git a/app/test/test_sched.c b/app/test/test_sched.c index c7239f80ab..1ef69106b0 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -46,10 +46,10 @@ #include -#define SUBPORT 0 -#define PIPE 1 -#define TC 2 -#define QUEUE 3 +#define SUBPORT 0 +#define PIPE 1 +#define TC 2 +#define QUEUE 3 static struct rte_sched_subport_params subport_param[] = { { -- 2.20.1