numam-dpdk/app/test
Bruce Richardson 0f3d92f373 telemetry: eliminate duplicate code for json output
When preparing the json response to a telemetry socket query, the code
for prefixing the command name, and appending the file "}" on the end of
the response was duplicated for multiple reply types. Taking this code
out of the switch statement reduces the duplication and makes the code
more maintainable.

For completeness of testing, add in a test case to validate the "null"
response type - the only leg of the switch statement not already covered
by an existing test case in the telemetry_data tests.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-26 13:49:38 +02:00
..
test_cfgfiles/etc
commands.c test: validate test names in non interactive mode 2022-06-13 11:18:39 +02:00
has_hugepage.py test: replace shell script with Python 2022-02-08 14:19:40 +01:00
meson.build test/cksum: add checksum performance test 2022-09-20 18:09:16 +02:00
packet_burst_generator.c test: remove POSIX-specific code 2022-02-08 14:19:40 +01:00
packet_burst_generator.h net: add rte prefix to UDP structure 2019-05-24 13:34:46 +02:00
process.h test: remove POSIX-specific code 2022-02-08 14:19:40 +01:00
resource.c
resource.h use appropriate EAL macro for constructors 2019-03-27 23:10:57 +01:00
sample_packet_forward.c test: fix ring PMD initialisation 2021-10-26 19:59:26 +02:00
sample_packet_forward.h test: fix ring PMD initialisation 2021-10-26 19:59:26 +02:00
test_acl.c remove unnecessary null checks 2022-06-24 14:51:09 +02:00
test_acl.h test/acl: add 32-bit range test case 2020-02-13 14:43:56 +01:00
test_alarm.c test/alarm: disable bad time cases on Windows 2022-02-08 14:19:40 +01:00
test_atomic.c fix spelling in comments and doxygen 2021-11-16 17:57:09 +01:00
test_barrier.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_bitmap.c test: add bitmap to fast tests 2021-11-10 11:42:34 +01:00
test_bitops.c test/bitops: add bit operations test case 2020-06-16 14:34:39 +02:00
test_bitratestats.c test: fix ring PMD initialisation 2021-10-26 19:59:26 +02:00
test_bpf.c test/bpf: skip test if libpcap is unavailable 2022-04-26 09:31:52 +02:00
test_byteorder.c test: remove POSIX-specific code 2022-02-08 14:19:40 +01:00
test_cfgfile.c test/cfgfile: replace license text with SPDX tag 2019-11-28 03:12:55 +01:00
test_cksum_perf.c test/cksum: add checksum performance test 2022-09-20 18:09:16 +02:00
test_cksum.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_cmdline_cirbuf.c
test_cmdline_etheraddr.c app: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
test_cmdline_ipaddr.c test: remove POSIX-specific code 2022-02-08 14:19:40 +01:00
test_cmdline_lib.c remove unnecessary null checks 2022-06-24 14:51:09 +02:00
test_cmdline_num.c test/cmdline: silence clang 12 warning 2021-04-21 00:44:24 +02:00
test_cmdline_portlist.c app: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
test_cmdline_string.c app: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
test_cmdline.c
test_cmdline.h
test_common.c eal: fix side effect in some pointer arithmetic macros 2022-09-21 15:31:03 +02:00
test_compressdev_test_buffer.h eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
test_compressdev.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_cpuflags.c test/cpuflags: add flags for RISC-V 2022-06-08 11:26:34 +02:00
test_crc.c test: check memory allocation for CRC 2022-06-26 19:53:05 +02:00
test_cryptodev_aead_test_vectors.h test/crypto: enable chacha_poly PMD 2021-10-20 15:33:16 +02:00
test_cryptodev_aes_test_vectors.h test/crypto: add multi-segment out-of-place AES-XTS 2021-07-20 22:27:00 +02:00
test_cryptodev_asym_util.h test/crypto: add ECPM cases 2020-01-15 15:01:55 +01:00
test_cryptodev_asym.c remove unnecessary null checks 2022-06-24 14:51:09 +02:00
test_cryptodev_blockcipher.c remove unnecessary null checks 2022-06-24 14:51:09 +02:00
test_cryptodev_blockcipher.h cryptodev: extend data-unit length field 2021-10-16 16:24:43 +02:00
test_cryptodev_des_test_vectors.h test/crypto: do not check for PMD 2020-04-19 22:45:40 +02:00
test_cryptodev_dh_test_vectors.h
test_cryptodev_dsa_test_vectors.h
test_cryptodev_ecdsa_test_vectors.h test/crypto: add ECDSA sign/verify cases 2020-01-15 15:01:55 +01:00
test_cryptodev_ecpm_test_vectors.h test/crypto: add ECPM cases 2020-01-15 15:01:55 +01:00
test_cryptodev_hash_test_vectors.h test/crypto: add AES-XCBC hash only test case 2021-01-19 18:05:45 +01:00
test_cryptodev_hmac_test_vectors.h
test_cryptodev_kasumi_hash_test_vectors.h
test_cryptodev_kasumi_test_vectors.h test/crypto: add KASUMI test cases for auth-cipher 2019-07-05 15:28:14 +02:00
test_cryptodev_mixed_test_vectors.h test/crypto: add additional stream cipher cases 2022-06-30 06:54:21 +02:00
test_cryptodev_mod_test_vectors.h doc: replace asym crypto code with literal includes 2022-02-12 10:26:39 +01:00
test_cryptodev_rsa_test_vectors.h cryptodev: fix RSA key type name 2022-02-22 20:21:20 +01:00
test_cryptodev_security_docsis_test_vectors.h test/crypto: refactor DOCSIS to show hidden cases 2021-11-04 19:46:27 +01:00
test_cryptodev_security_ipsec_test_vectors.h test/crypto: add AH AES-GMAC test vectors 2022-04-28 08:54:50 +02:00
test_cryptodev_security_ipsec.c test/crypto: remove Windows conditional compilation 2022-06-21 17:10:45 +02:00
test_cryptodev_security_ipsec.h test/security: add inline IPsec IPv6 flow label cases 2022-06-01 16:26:34 +02:00
test_cryptodev_security_pdcp_sdap_test_vectors.h test/crypto: add test vectors for PDCP-SDAP 2020-10-14 22:24:41 +02:00
test_cryptodev_security_pdcp_test_func.h test/crypto: add PDCP U-Plane decap cases 2019-10-09 11:50:12 +02:00
test_cryptodev_security_pdcp_test_vectors.h test/crypto: add short MAC-I test vector for ZUC 2022-06-01 16:26:35 +02:00
test_cryptodev_security_pdcp.c test/crypto: remove Windows conditional compilation 2022-06-21 17:10:45 +02:00
test_cryptodev_snow3g_hash_test_vectors.h
test_cryptodev_snow3g_test_vectors.h test/crypto: add additional stream cipher cases 2022-06-30 06:54:21 +02:00
test_cryptodev_zuc_test_vectors.h test/crypto: add additional stream cipher cases 2022-06-30 06:54:21 +02:00
test_cryptodev.c test/crypto: add additional stream cipher cases 2022-06-30 06:54:21 +02:00
test_cryptodev.h remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_cycles.c test: remove strict timing requirements some tests 2021-06-03 18:08:57 +02:00
test_debug.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_devargs.c bus: hide bus object 2022-09-23 16:14:34 +02:00
test_distributor_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_distributor.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_dmadev_api.c test/dma: add dmadev API test 2021-10-17 20:49:58 +02:00
test_dmadev_api.h test/dma: add dmadev API test 2021-10-17 20:49:58 +02:00
test_dmadev.c test/dma: reset last index before checking completion 2022-06-15 16:15:50 +02:00
test_eal_flags.c eal/linux: allocate worker lcore stacks in hugepages 2022-06-23 22:36:33 +02:00
test_eal_fs.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_efd_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_efd.c test/efd: fix sockets mask size 2022-02-27 18:57:45 +01:00
test_errno.c eal: differentiate strerror message on Windows 2022-02-08 14:19:40 +01:00
test_ethdev_link.c ethdev: add namespace 2021-10-22 18:15:38 +02:00
test_event_crypto_adapter.c test/event: add asymmetric cases for crypto adapter 2022-06-01 16:26:34 +02:00
test_event_eth_rx_adapter.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_event_eth_tx_adapter.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_event_ring.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_event_timer_adapter.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_eventdev.c test/event: set queue attributes at runtime 2022-05-17 16:43:48 +02:00
test_external_mem.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_fbarray.c eal: hide shared memory config 2019-07-06 10:32:34 +02:00
test_fib6_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_fib6.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_fib_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_fib.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_flow_classify.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_flow_classify.h
test_func_reentrancy.c remove unnecessary null checks 2022-06-24 14:51:09 +02:00
test_graph_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_graph.c graph: remove useless duplicate name check 2022-03-07 20:31:14 +01:00
test_hash_functions.c app: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
test_hash_multiwriter.c test/hash: use compiler atomics for sync 2021-10-19 17:15:10 +02:00
test_hash_perf.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_hash_readwrite_lf_perf.c test/hash: fix out of bound access 2022-06-26 17:18:41 +02:00
test_hash_readwrite.c test/hash: report non HTM numbers for single thread 2022-05-11 14:01:03 +02:00
test_hash.c remove unnecessary null checks 2022-06-24 14:51:09 +02:00
test_interrupts.c test/interrupts: skip on Windows 2022-02-08 14:19:40 +01:00
test_ipfrag.c ip_frag: add IPv4 fragment copy 2022-08-29 16:24:18 +02:00
test_ipsec_perf.c test/ipsec: fix performance test 2022-06-21 20:04:50 +02:00
test_ipsec_sad.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_ipsec.c test/ipsec: fix build with GCC 12 2022-06-21 20:04:50 +02:00
test_kni.c kni: stop populating PCI info in examples 2022-09-23 16:14:33 +02:00
test_kvargs.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_latencystats.c test: fix ring PMD initialisation 2021-10-26 19:59:26 +02:00
test_lcores.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_link_bonding_mode4.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_link_bonding_rssconf.c test/bonding: fix RSS test when disable RSS 2022-06-09 10:47:29 +02:00
test_link_bonding.c net/bonding: fix slaves initializing on MTU setting 2022-02-17 12:55:21 +01:00
test_logs.c test/log: skip regex on Windows 2022-02-08 14:19:40 +01:00
test_lpm6_data.h fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_lpm6_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_lpm6.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_lpm_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_lpm.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_malloc_perf.c app/test: add allocator performance benchmark 2022-02-08 21:32:53 +01:00
test_malloc.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_mbuf.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_mcslock.c test/mcslock: use compiler atomics for lcores sync 2021-07-30 19:10:58 +02:00
test_member_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_member.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_memcpy_perf.c test: remove POSIX-specific code 2022-02-08 14:19:40 +01:00
test_memcpy.c app: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
test_memory.c test/mem: disable ASan when accessing unallocated memory 2022-05-11 14:05:30 +02:00
test_mempool_perf.c mempool: test performance with constant n 2022-02-02 22:06:14 +01:00
test_mempool.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_memzone.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_meter.c fix spelling in comments and doxygen 2021-11-16 17:57:09 +01:00
test_metrics.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_mp_secondary.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_pcapng.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_pdump.c test: fix ring PMD initialisation 2021-10-26 19:59:26 +02:00
test_pdump.h
test_per_lcore.c eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
test_pflock.c pflock: add phase-fair reader writer locks 2021-04-14 21:59:47 +02:00
test_pie.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_pmd_perf.c test: avoid hang if queues are full and Tx fails 2022-05-25 10:01:05 +02:00
test_pmd_ring_perf.c test: check stop call status 2020-10-16 22:26:41 +02:00
test_pmd_ring.c test: check stop call status 2020-10-16 22:26:41 +02:00
test_power_cpufreq.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_power_kvm_vm.c build: replace use of old build macros 2020-10-19 22:15:44 +02:00
test_power.c power: support cppc_cpufreq driver 2021-07-09 16:04:46 +02:00
test_prefetch.c test: fix build with GCC 11 2021-05-20 23:10:22 +02:00
test_rand_perf.c eal: provide pseudo-random floating point number 2022-06-22 10:59:09 +02:00
test_rawdev.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_rcu_qsbr_perf.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_rcu_qsbr.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_reciprocal_division_perf.c test: fix division by zero 2021-05-19 09:23:00 +02:00
test_reciprocal_division.c
test_red.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_reorder.c remove unnecessary null checks 2022-02-12 12:07:48 +01:00
test_resource.c
test_rib6.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_rib.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_ring_hts_stress.c test/ring: add contention stress test for HTS ring 2020-04-21 12:52:55 +02:00
test_ring_mpmc_stress.c test/ring: add contention stress test 2020-04-21 11:34:09 +02:00
test_ring_mt_peek_stress_zc.c test/ring: fix build for O1 optimization 2020-11-15 16:45:48 +01:00
test_ring_mt_peek_stress.c test/ring: rename stress test for MT peek API 2020-07-03 12:36:04 +02:00
test_ring_perf.c test/ring_perf: use compiler atomic builtins for lcores sync 2021-11-17 11:07:06 +01:00
test_ring_rts_stress.c test/ring: add contention stress test for RTS ring 2020-04-21 12:52:55 +02:00
test_ring_st_peek_stress_zc.c test/ring: add stress tests for zero copy API 2020-10-29 14:13:31 +01:00
test_ring_st_peek_stress.c test/ring: add stress test for ST peek API 2020-07-03 12:05:25 +02:00
test_ring_stress_impl.h test: remove POSIX-specific code 2022-02-08 14:19:40 +01:00
test_ring_stress.c test/ring: add stress tests for zero copy API 2020-10-29 14:13:31 +01:00
test_ring_stress.h test/ring: add stress tests for zero copy API 2020-10-29 14:13:31 +01:00
test_ring.c app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
test_ring.h test/ring: remove excessive inlining 2022-05-23 15:29:39 +02:00
test_rwlock.c test: remove unnecessary test commands 2021-11-16 16:28:53 +01:00
test_sched.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_security_inline_proto_vectors.h test/security: add inline IPsec reassembly cases 2022-06-01 16:26:34 +02:00
test_security_inline_proto.c test/security: add event inline IPsec cases 2022-06-28 10:24:41 +02:00
test_security.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_seqlock.c eal: add seqlock 2022-06-07 13:33:14 +02:00
test_service_cores.c test/service: fix race in attr check 2021-10-12 21:07:30 +02:00
test_spinlock.c test/spinlock: use compile atomics for lcores sync 2021-07-30 19:06:35 +02:00
test_stack_perf.c test/stack_perf: use compiler atomics for lcore sync 2021-11-17 11:07:06 +01:00
test_stack.c stack: remove unneeded atomic header include 2021-10-19 17:15:10 +02:00
test_string_fns.c
test_table_acl.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_table_acl.h
test_table_combined.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_table_combined.h build: replace use of old build macros 2020-10-19 22:15:44 +02:00
test_table_pipeline.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_table_pipeline.h
test_table_ports.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_table_ports.h
test_table_tables.c replace zero-length arrays with flexible ones 2022-06-07 16:44:21 +02:00
test_table_tables.h build: replace use of old build macros 2020-10-19 22:15:44 +02:00
test_table.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_table.h build: replace use of old build macros 2020-10-19 22:15:44 +02:00
test_tailq.c remove useless include of EAL memory config header 2019-10-09 10:22:24 +02:00
test_telemetry_data.c telemetry: eliminate duplicate code for json output 2022-09-26 13:49:38 +02:00
test_telemetry_json.c test/telemetry_json: add test for string escaping in objects 2022-09-26 13:49:11 +02:00
test_telemetry.sh test: invoke all telemetry commands 2022-08-25 16:23:17 +02:00
test_thash_perf.c test/thash: fix build with clang 13 2021-11-16 13:01:52 +01:00
test_thash.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
test_threads.c test/threads: add unit test for get/set priority 2022-06-07 13:33:14 +02:00
test_ticketlock.c test/ticketlock: use compiler atomics for lcores sync 2021-07-30 19:04:34 +02:00
test_timer_perf.c build/linux: rename macro from LINUXAPP to LINUX 2019-03-12 17:31:22 +01:00
test_timer_racecond.c test/timer: remove license boilerplate 2021-05-19 11:02:45 +02:00
test_timer_secondary.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_timer.c test/timer: use compiler atomic builtins for sync 2021-11-17 11:07:06 +01:00
test_trace_perf.c test/trace: fix race on collected perf data 2021-04-14 16:12:44 +02:00
test_trace_register.c trace: simplify trace point registration 2020-07-05 21:34:21 +02:00
test_trace.c test: skip unsupported tests on Windows 2022-02-08 14:19:40 +01:00
test_trace.h test/trace: add functional test cases 2020-04-23 15:40:03 +02:00
test_vdev.c dev: introduce device accessors 2022-09-23 16:14:34 +02:00
test_version.c
test_xmmt_ops.h eal/riscv: support RISC-V architecture 2022-06-08 11:26:20 +02:00
test.c test: validate test names in non interactive mode 2022-06-13 11:18:39 +02:00
test.h eal: remove unneeded includes from a public header 2022-09-21 15:31:03 +02:00
virtual_pmd.c bus/pci: make driver-only headers private 2022-09-23 16:14:34 +02:00
virtual_pmd.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00