aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2018-12-11 23:45:36 +0100
committerPeter Wu <peter@lekensteyn.nl>2018-12-13 23:33:32 +0000
commit5bf37f63a880cc29b1ae12e73489b84c09ef7bf9 (patch)
tree32f6b367efdb24e9c87d255b42f15b6acfbb1355 /test
parenta87e56aa79f62ba8967e63da9d408e464596cd85 (diff)
text2pcap: allow to set interface name
When generating a capture file from a text file it can be helpfull to be able to set the capture interface name in the generated IDB. This can be especially true if later on the generated captures are merged and the individual IDB's have to be compared. Without a name every IDB of the same datalink type will be equal and subject to merge. Also it keeps the individual streams identifiable for the end user. Change-Id: I70224379d88f516a0a356bf0b46aebafb69665f0 Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-on: https://code.wireshark.org/review/31015 Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test')
-rw-r--r--test/suite_text2pcap.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/suite_text2pcap.py b/test/suite_text2pcap.py
index f07d0a3ec7..79bd1397fe 100644
--- a/test/suite_text2pcap.py
+++ b/test/suite_text2pcap.py
@@ -540,3 +540,20 @@ class case_text2pcap_i_proto(subprocesstest.SubprocessTestCase):
"0010 00 00 00 00 00 00 00 00 00 00 00 03 01 00 03 03\n" +
"0020 00 00 00 08\n",
("-i", "132", "-6", "::1,::1")))
+
+
+@fixtures.mark_usefixtures('base_env')
+@fixtures.uses_fixtures
+class case_text2pcap_other_options(subprocesstest.SubprocessTestCase):
+ '''Test other command line options'''
+ def test_text2pcap_option_N(self, cmd_text2pcap, cmd_tshark, capture_file):
+ '''Test -N <intf-name> option'''
+ testin_file = self.filename_from_id(testin_txt)
+ testout_file = self.filename_from_id(testout_pcapng)
+
+ with open(testin_file, 'w') as f:
+ f.write("0000 00\n")
+ f.close()
+ self.assertRun((cmd_text2pcap, "-n", "-N", "your-interface-name", testin_file, testout_file))
+ proc = self.assertRun((cmd_tshark, "-r", testout_file, "-Tfields", "-eframe.interface_name", "-c1"))
+ self.assertEqual(proc.stdout_str.rstrip(), "your-interface-name")