MISP-Taxii-Server/tests/test_upload.py

22 lines
680 B
Python
Raw Normal View History

2016-11-18 14:51:01 +01:00
#!/usr/bin/env python
import subprocess
import glob
def test_push():
for fname in glob.glob("*.xml"):
proc = subprocess.Popen([
"taxii-push",
Squashed commit of the following: commit 3389560fe994c7c17d678c695128fe90824634d6 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Sat Nov 19 15:38:11 2016 +0000 Removed unicode things commit 060f94f565caad28ea66b9a3826b84476dac8b92 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 16:10:28 2016 +0000 Apparently output goes to stderr? commit b41109dd9e2d8df943e40a46153bc8c4e5bd971b Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 16:01:39 2016 +0000 127 not localhost? commit 77c45273b0755c2c16e85936ca2b76b249cc95d9 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:54:12 2016 +0000 Allow server time to start up commit ee06ff076542d269468db5cc7cd2f9f157af16eb Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:48:38 2016 +0000 sudo sudo commit 9f0f31c0234a3c226e7d8ecdd7d9f95afcc77f60 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:47:45 2016 +0000 Move sql install to before_install commit 51b49dc1760643efe3a01756cfdca7fdb335be8e Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:46:02 2016 +0000 Fixed a typo commit 2b90620b4cb0d319dfebe8415d7a4fd0e75f2bf3 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:45:10 2016 +0000 Mysql pls commit 7f4e2b9f6213dd0a39ef38754c3aa6b19a2432aa Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:42:32 2016 +0000 Switch to trusty travis commit 64e39b798347740cd4700f6a2ac0dd9589a87ac1 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:35:31 2016 +0000 Switch to trusty travis commit 44685648608a04cba1b933479654159d4bf804ac Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:30:30 2016 +0000 Stop being a tard commit 0a9f534fa71bce3625c39f6cb28c294a57406806 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:28:04 2016 +0000 Check mysql version commit 887a6d82a7f8fc243f8d0740e97fbf85cb3c3c29 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:17:26 2016 +0000 Print a bit of debug info
2016-11-19 16:42:54 +01:00
"--path", "http://127.0.0.1:9000/services/inbox",
2016-11-18 14:51:01 +01:00
"-f", fname,
"--dest", "collection",
"--username", "travis",
"--password", "travis"
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
out,err = proc.communicate()
Squashed commit of the following: commit 3389560fe994c7c17d678c695128fe90824634d6 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Sat Nov 19 15:38:11 2016 +0000 Removed unicode things commit 060f94f565caad28ea66b9a3826b84476dac8b92 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 16:10:28 2016 +0000 Apparently output goes to stderr? commit b41109dd9e2d8df943e40a46153bc8c4e5bd971b Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 16:01:39 2016 +0000 127 not localhost? commit 77c45273b0755c2c16e85936ca2b76b249cc95d9 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:54:12 2016 +0000 Allow server time to start up commit ee06ff076542d269468db5cc7cd2f9f157af16eb Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:48:38 2016 +0000 sudo sudo commit 9f0f31c0234a3c226e7d8ecdd7d9f95afcc77f60 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:47:45 2016 +0000 Move sql install to before_install commit 51b49dc1760643efe3a01756cfdca7fdb335be8e Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:46:02 2016 +0000 Fixed a typo commit 2b90620b4cb0d319dfebe8415d7a4fd0e75f2bf3 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:45:10 2016 +0000 Mysql pls commit 7f4e2b9f6213dd0a39ef38754c3aa6b19a2432aa Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:42:32 2016 +0000 Switch to trusty travis commit 64e39b798347740cd4700f6a2ac0dd9589a87ac1 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:35:31 2016 +0000 Switch to trusty travis commit 44685648608a04cba1b933479654159d4bf804ac Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:30:30 2016 +0000 Stop being a tard commit 0a9f534fa71bce3625c39f6cb28c294a57406806 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:28:04 2016 +0000 Check mysql version commit 887a6d82a7f8fc243f8d0740e97fbf85cb3c3c29 Author: Hannah Ward <Hannah.ward9001@gmail.com> Date: Fri Nov 18 15:17:26 2016 +0000 Print a bit of debug info
2016-11-19 16:42:54 +01:00
assert("Content block successfully pushed" in err.decode("utf-8"))