György Kohut avatar György Kohut committed c28857c

add test scripts for sending to jms

Comments (0)

Files changed (2)

test/stomp/send_to_new_binary.py

+import sys
+
+# stomp.py 3.1.3
+import stomp
+
+def usage():
+	print >> sys.stderr, 'usage: %s <id> <md5>' % sys.argv[0]
+
+if len(sys.argv) != 2+1:
+	usage()
+	exit(1)
+
+id = sys.argv[1]
+md5 = sys.argv[2]
+
+conn = stomp.Connection(host_and_ports=[('localhost', 9972)], user='admin', passcode='admin')
+conn.start()
+conn.connect()
+
+conn.send(message='', headers={'id': id, 'md5': md5}, destination='/topic/new_binary')
+conn.disconnect()
+
+
+# example usage:
+# PGPASSWORD=hbbackend psql -h localhost -U hbbackend -d hbbackend -c 'select id, md5 from binaries order by id;' -A  -F ' ' -t | xargs -I'{}' sh -c 'echo {} ; python test/stomp/send_to_new_binary.py {}'
+#
+

test/stomp/send_to_new_ip.py

+import sys
+
+# stomp.py 3.1.3
+import stomp
+
+def usage():
+	print >> sys.stderr, 'usage: %s <ip>' % sys.argv[0]
+
+if len(sys.argv) != 1+1:
+	usage()
+	exit(1)
+
+ip = sys.argv[1]
+
+conn = stomp.Connection(host_and_ports=[('localhost', 9972)], user='admin', passcode='admin')
+conn.start()
+conn.connect()
+
+conn.send(message='', headers={'ip': ip}, destination='/topic/new_ip')
+conn.disconnect()
+
+
+# example usage:
+# PGPASSWORD=hbbackend psql -h localhost -U hbbackend -d hbbackend -c 'select ip from ips_source;' -A  -F ' ' -t | xargs -I'{}' sh -c 'echo {} ; python test/stomp/send_to_new_ip.py {}'
+#
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.