Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add some simple unit tests

  • Loading branch information...
commit f74c56dce1093f69b1859c7018463ae026f7fd29 1 parent 51c07ab
@zenchild authored
Showing with 39 additions and 0 deletions.
  1. +24 −0 test/spec/gssapi_simple_spec.rb
  2. +15 −0 test/spec/test_buffer_spec.rb
View
24 test/spec/gssapi_simple_spec.rb
@@ -0,0 +1,24 @@
+$: << File.dirname(__FILE__) + '/../../lib/'
+require 'gssapi'
+require 'base64'
+require 'yaml'
+
+
+describe GSSAPI::Simple, 'Test the Simple GSSAPI interface' do
+
+ before :all do
+ @conf = YAML.load_file "#{File.dirname(__FILE__)}/conf_file.yaml"
+ end
+
+ it 'should get the initial context for a client' do
+ gsscli = GSSAPI::Simple.new(@conf[:c_host], @conf[:c_service])
+ token = gsscli.init_context
+ token.should_not be_empty
+ end
+
+ it 'should acquire credentials for a server service' do
+ gsscli = GSSAPI::Simple.new(@conf[:s_host], @conf[:s_service], @conf[:keytab])
+ gsscli.acquire_credentials.should be_true
+ end
+
+end
View
15 test/spec/test_buffer_spec.rb
@@ -0,0 +1,15 @@
+$: << File.dirname(__FILE__) + '/../../lib/'
+require 'gssapi'
+
+describe GSSAPI::LibGSSAPI::UnManagedGssBufferDesc, 'Unmanaged Buffer Test' do
+ it 'should create a new UnManagedGssBufferDesc and assign to it and test GC' do
+ 0.upto 100 do |i|
+ b = GSSAPI::LibGSSAPI::UnManagedGssBufferDesc.new
+ GC.start
+ b.value = 'asdf'
+ end
+
+ # If we get here without any errors we should be golden
+ true.should be_true
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.