Module: Fluent::Test::StartupShutdown

Defined in:
lib/fluent/test/startup_shutdown.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setupObject



33
34
35
36
37
# File 'lib/fluent/test/startup_shutdown.rb', line 33

def self.setup
  @socket_manager_path = ServerEngine::SocketManager::Server.generate_path
  @server = ServerEngine::SocketManager::Server.open(@socket_manager_path)
  ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = @socket_manager_path.to_s
end

.teardownObject



39
40
41
42
43
# File 'lib/fluent/test/startup_shutdown.rb', line 39

def self.teardown
  @server.close
  # on Windows, socket_manager_path is a TCP port number
  FileUtils.rm_f @socket_manager_path unless Fluent.windows?
end

Instance Method Details

#shutdownObject



29
30
31
# File 'lib/fluent/test/startup_shutdown.rb', line 29

def shutdown
  @server.close
end

#startupObject



23
24
25
26
27
# File 'lib/fluent/test/startup_shutdown.rb', line 23

def startup
  socket_manager_path = ServerEngine::SocketManager::Server.generate_path
  @server = ServerEngine::SocketManager::Server.open(socket_manager_path)
  ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = socket_manager_path.to_s
end