mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 18:35:18 +00:00
simplified awk expression, fixed unit test
This commit is contained in:
parent
14075de0d8
commit
59a115eb72
@ -341,7 +341,7 @@ class NetTcp(AbstractMetric):
|
||||
if note set it to 0.
|
||||
* make output ordered as "fields" list
|
||||
'''
|
||||
fetch = lambda: commands.getoutput("ss -s | awk -F'(\()|(\)|(\/))' '$0 ~ \"TCP:\" {print $2}'")
|
||||
fetch = lambda: commands.getoutput("ss -s | awk -F'\(|\)|\/' '/^TCP:/ {print $2}'")
|
||||
data = {}
|
||||
result = []
|
||||
raw_lines = fetch().split(',')
|
||||
|
@ -115,8 +115,8 @@ class NetTcpTestCase(unittest.TestCase):
|
||||
|
||||
def test_net_tcp_(self):
|
||||
print self.foo.check()
|
||||
self.assertEquals(4, len(self.foo.check()))
|
||||
self.assertNotEquals(['0', '0', '0', '0'], self.foo.check())
|
||||
self.assertEquals(3, len(self.foo.check()))
|
||||
self.assertNotEquals(['0', '0', '0'], self.foo.check())
|
||||
|
||||
|
||||
class NetTxRxTestCase(unittest.TestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user