Add a ruby script for interactive command line testing of json_gssapi
authorMark Donnelly <mark@painless-security.com>
Wed, 8 Jul 2015 17:03:04 +0000 (13:03 -0400)
committerMark Donnelly <mark@painless-security.com>
Wed, 8 Jul 2015 17:03:04 +0000 (13:03 -0400)
json_gssapi/test.rb [new file with mode: 0644]

diff --git a/json_gssapi/test.rb b/json_gssapi/test.rb
new file mode 100644 (file)
index 0000000..6880d87
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+
+require 'open3'
+
+Open3.popen2('./json_gssapi') do |inIo, outIo, wait_thr|
+  puts "gdb --pid=#{wait_thr.pid}"
+  while(true) do
+    a = gets
+    inIo.puts  [a.length].pack('L') + a
+    inIo.flush
+
+    outIo.flush
+    b = outIo.read(4)
+    puts b
+    c = outIo.read(b.unpack('L')[0])
+    puts c
+  end
+end
+