radcli 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +0 -0
- data/LICENSE +201 -0
- data/MANIFEST +13 -0
- data/README.md +109 -0
- data/Rakefile +65 -0
- data/build_adcli.sh +6 -0
- data/ext/lib/libadcli.a +0 -0
- data/ext/radcli/adconn.h +147 -0
- data/ext/radcli/adenroll.h +143 -0
- data/ext/radcli/adutil.h +94 -0
- data/ext/radcli/extconf.rb +16 -0
- data/ext/radcli/radcli.c +13 -0
- data/ext/radcli/radcli.h +31 -0
- data/ext/radcli/radconn.c +291 -0
- data/ext/radcli/radenroll.c +278 -0
- data/radcli.gemspec +26 -0
- data/scripts/delete.rb +20 -0
- data/scripts/fail_adconnect.rb +46 -0
- data/scripts/join.rb +22 -0
- data/scripts/reset.rb +24 -0
- data/test/test_radconn.rb +110 -0
- data/test/test_radenroll.rb +74 -0
- metadata +104 -0
@@ -0,0 +1,74 @@
|
|
1
|
+
########################################################################
|
2
|
+
# test_radenroll.rb
|
3
|
+
#
|
4
|
+
# Test suite for the Adcli::AdEnroll
|
5
|
+
#
|
6
|
+
require 'rubygems'
|
7
|
+
gem 'test-unit'
|
8
|
+
|
9
|
+
require 'test/unit'
|
10
|
+
require 'radcli'
|
11
|
+
|
12
|
+
class TC_AdEnroll < Test::Unit::TestCase
|
13
|
+
def setup
|
14
|
+
@domain = "TEST.DOMAIN"
|
15
|
+
@realm = "TEST.REALM"
|
16
|
+
@domain_controller = "TEST-DC"
|
17
|
+
@ccache_name = "testccache"
|
18
|
+
@login_user = "testuser"
|
19
|
+
@user_password = "testpassword"
|
20
|
+
|
21
|
+
@host_fqdn = "computer.test.domain"
|
22
|
+
@computer_name = "computer"
|
23
|
+
@computer_password = "computer-password"
|
24
|
+
|
25
|
+
@conn = Adcli::AdConn.new(@domain)
|
26
|
+
@enroll = Adcli::AdEnroll.new(@conn)
|
27
|
+
end
|
28
|
+
|
29
|
+
test "argument to constructor must be a string" do
|
30
|
+
assert_raise(TypeError){ Adcli::AdEnroll.new(1) }
|
31
|
+
assert_raise(TypeError){ Adcli::AdEnroll.new(true) }
|
32
|
+
end
|
33
|
+
|
34
|
+
test "constructor accepts a connection object" do
|
35
|
+
assert_nothing_raised{ Adcli::AdEnroll.new(@conn) }
|
36
|
+
end
|
37
|
+
|
38
|
+
test "argument to host fqdn setter must be a string" do
|
39
|
+
assert_raise(TypeError){ @enroll.set_host_fqdn(1) }
|
40
|
+
assert_raise(TypeError){ @enroll.set_host_fqdn(true) }
|
41
|
+
end
|
42
|
+
|
43
|
+
test "host fqdn setter/getter sets/returns value" do
|
44
|
+
@enroll.set_host_fqdn(@host_fqdn)
|
45
|
+
host_fqdn = @enroll.get_host_fqdn()
|
46
|
+
assert_equal(@host_fqdn, host_fqdn)
|
47
|
+
end
|
48
|
+
|
49
|
+
test "argument to computer name setter must be a string" do
|
50
|
+
assert_raise(TypeError) { @enroll.set_computer_name(1) }
|
51
|
+
assert_raise(TypeError) { @enroll.set_computer_name(true) }
|
52
|
+
end
|
53
|
+
|
54
|
+
test "computer name setter/getter sets/returns value" do
|
55
|
+
@enroll.set_computer_name(@computer_name)
|
56
|
+
computer_name = @enroll.get_computer_name()
|
57
|
+
assert_equal(@computer_name, computer_name)
|
58
|
+
end
|
59
|
+
|
60
|
+
test "argument do passwod setter must be a string" do
|
61
|
+
assert_raise(TypeError) { @enroll.set_computer_password(1) }
|
62
|
+
assert_raise(TypeError) { @enroll.set_computer_password(true) }
|
63
|
+
end
|
64
|
+
|
65
|
+
test "computer password setter/getter sets/returns value" do
|
66
|
+
@enroll.set_computer_password(@computer_password)
|
67
|
+
computer_password = @enroll.get_computer_password()
|
68
|
+
assert_equal(@computer_password, computer_password)
|
69
|
+
end
|
70
|
+
|
71
|
+
def teardown
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: radcli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mårten Cassel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-12-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake-compiler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: test-unit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.1.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.1.0
|
41
|
+
description: " The radcli library provides a Ruby interface for performing actions
|
42
|
+
on \n a Active Directory domain using the realmd/adcli tool library.\n"
|
43
|
+
email:
|
44
|
+
- marten.cassel@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions:
|
47
|
+
- ext/radcli/extconf.rb
|
48
|
+
extra_rdoc_files:
|
49
|
+
- README.md
|
50
|
+
- CHANGES
|
51
|
+
- MANIFEST
|
52
|
+
- ext/radcli/radcli.c
|
53
|
+
- ext/radcli/radconn.c
|
54
|
+
- ext/radcli/radenroll.c
|
55
|
+
files:
|
56
|
+
- CHANGES
|
57
|
+
- LICENSE
|
58
|
+
- MANIFEST
|
59
|
+
- README.md
|
60
|
+
- Rakefile
|
61
|
+
- build_adcli.sh
|
62
|
+
- ext/lib/libadcli.a
|
63
|
+
- ext/radcli/adconn.h
|
64
|
+
- ext/radcli/adenroll.h
|
65
|
+
- ext/radcli/adutil.h
|
66
|
+
- ext/radcli/extconf.rb
|
67
|
+
- ext/radcli/radcli.c
|
68
|
+
- ext/radcli/radcli.h
|
69
|
+
- ext/radcli/radconn.c
|
70
|
+
- ext/radcli/radenroll.c
|
71
|
+
- radcli.gemspec
|
72
|
+
- scripts/delete.rb
|
73
|
+
- scripts/fail_adconnect.rb
|
74
|
+
- scripts/join.rb
|
75
|
+
- scripts/reset.rb
|
76
|
+
- test/test_radconn.rb
|
77
|
+
- test/test_radenroll.rb
|
78
|
+
homepage: http://github.com/martencassel/radcli
|
79
|
+
licenses:
|
80
|
+
- Artistic-2.0
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.5.1
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: A Ruby interface for the adcli library
|
102
|
+
test_files:
|
103
|
+
- test/test_radconn.rb
|
104
|
+
- test/test_radenroll.rb
|