forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a first test based on the mysql integration test suite
- Loading branch information
Tudor Golubenco
committed
Dec 4, 2014
1 parent
3ee628e
commit 511b7a0
Showing
5 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
Submodule packetbeat
updated
from 3eed90 to f87f18
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pbtests.packetbeat import TestCase | ||
|
||
""" | ||
Tests based on the MySQL integration test suite. | ||
""" | ||
|
||
|
||
class Test(TestCase): | ||
|
||
def test_string_operations(self): | ||
self.render_config_template( | ||
mysql_ports=[13001] | ||
) | ||
self.run_packetbeat(pcap="mysql_int_string_operations.pcap") | ||
|
||
objs = self.read_output() | ||
assert all([o["type"] == "mysql" for o in objs]) | ||
assert len(objs) == 157 | ||
assert all([o["dst_port"] == 13001 for o in objs]) | ||
|
||
assert len([o for o in objs if o["mysql"]["method"] == "SELECT"]) == 134 | ||
assert len([o for o in objs if o["mysql"]["method"] == "SHOW"]) == 10 | ||
assert len([o for o in objs if o["mysql"]["method"] == "ALTER"]) == 4 | ||
assert len([o for o in objs if o["mysql"]["method"] == "SET"]) == 3 | ||
assert len([o for o in objs if o["mysql"]["method"] == "CREATE"]) == 2 | ||
assert len([o for o in objs if o["mysql"]["method"] == "CREATE"]) == 2 |