1NAME = "Pktgen test" 2AUTHOR = "Martin Bligh <mbligh@google.com>" 3TIME = "MEDIUM" 4TEST_CATEGORY = "FUNCTIONAL" 5TEST_CLASS = "HARDWARE" 6TEST_TYPE = "CLIENT" 7DOC = """ 8pktgen is a high-performance testing tool included in the Linux kernel. Being 9part of the kernel is currently best way to test the TX process of device driver 10and NIC. pktgen can also be used to generate ordinary packets to test other 11network devices. Especially of interest is the use of pktgen to test routers or 12bridges which use the Linux network stack. Because pktgen is "in-kernel", it can 13generate very high packet rates and with few systems saturate network devices as 14routers or bridges. 15""" 16 17interface='eth0' 18count=50000 19 20# Parse comma-separated args. 21for arg in args: 22 for item in arg.split(','): 23 key, val = item.split('=') 24 if key == 'interface': 25 interface = val 26 if key == 'count': 27 count = int(val) 28 if key == 'num_iterations': 29 num_iterations = int(val) 30 31job.run_test('pktgen', eth=interface, count=count, clone_skb=0, 32 tag='clone_skb_off', num_iterations=num_iterations) 33job.run_test('pktgen', eth=interface, count=count, clone_skb=1, 34 tag='clone_skb_on', num_iterations=num_iterations) 35 36