mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
Update 'echo' tests
This commit is contained in:
@ -77,10 +77,20 @@
|
||||
"root +pts\/0 +2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-3][0-9]:[0-5][0-9][0-9(). ]+",
|
||||
"root@unitTest:~# "
|
||||
],
|
||||
"echo": [
|
||||
"echo": {
|
||||
"plain": [
|
||||
"test worked correctly",
|
||||
"root@unitTest:~# "
|
||||
],
|
||||
"ne_double": [
|
||||
"ELF",
|
||||
"root@unitTest:~# "
|
||||
],
|
||||
"ne_single": [
|
||||
"ELF",
|
||||
"root@unitTest:~# "
|
||||
]
|
||||
},
|
||||
"hostname": [
|
||||
"root@unitChanged:~# "
|
||||
],
|
||||
|
||||
@ -52,8 +52,11 @@ class ShellBaseCommandsTests(unittest.TestCase):
|
||||
|
||||
def test_echo_command(self):
|
||||
self.proto.lineReceived('echo "test worked correctly" \n')
|
||||
self.assertEquals(self.tr.value(),"\n".join(self.data['results']['echo']))
|
||||
|
||||
self.assertEquals(self.tr.value(),"\n".join(self.data['results']['echo']['plain']))
|
||||
self.proto.lineReceived('echo -ne "\x27\x22\x45\x4c\x46\x27\x22" \n')
|
||||
self.assertEquals(self.tr.value(), "\n".join(self.data['results']['echo']['ne_double']))
|
||||
self.proto.lineReceived('echo -ne \'\x27\x22\x45\x4c\x46\x27\x22\' \n')
|
||||
self.assertEquals(self.tr.value(), "\n".join(self.data['results']['echo']['ne_single']))
|
||||
|
||||
def test_exit_command(self):
|
||||
self.proto.lineReceived('exit \n')
|
||||
|
||||
Reference in New Issue
Block a user