Class: Rex::ServiceManager::UnitTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/rex/service_manager.rb.ut.rb

Constant Summary collapse

Klass =
Rex::ServiceManager

Instance Method Summary collapse

Instance Method Details

#test_svcmObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rex/service_manager.rb.ut.rb', line 12

def test_svcm
	begin
		c = Klass
		s = c.start(Rex::Proto::Http::Server, 8090)
		assert_not_nil(s)
		t = c.start(Rex::Proto::Http::Server, 8090)
		assert_not_nil(t)
		assert_equal(s, t)
		z = c.start(Rex::Proto::Http::Server, 8091)
		assert_not_equal(t, z)
		assert_equal("HTTP Server", s.alias)
		assert_equal("HTTP Server 1", z.alias)
	ensure
		c.stop_by_alias(s.alias) if (s)
		c.stop_by_alias(z.alias) if (z)
		c.stop_by_alias(t.alias) if (t)
	end

end