From 1a3ae869430ac306c5bb14a7d241c48654d95a58 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 4 Apr 2017 14:23:36 -0700 Subject: [PATCH] (POOLER-70) Add config for VM Provider This commit adds a public function to access the internal variable holding the VMPooler configuration. This is required for later commits for the execute! function testing. --- lib/vmpooler/pool_manager.rb | 4 ++++ spec/unit/pool_manager_spec.rb | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/vmpooler/pool_manager.rb b/lib/vmpooler/pool_manager.rb index 7ab229f..2133c53 100644 --- a/lib/vmpooler/pool_manager.rb +++ b/lib/vmpooler/pool_manager.rb @@ -19,6 +19,10 @@ module Vmpooler $threads = {} end + def config + $config + end + # Check the state of a VM def check_pending_vm(vm, pool, timeout, provider) Thread.new do diff --git a/spec/unit/pool_manager_spec.rb b/spec/unit/pool_manager_spec.rb index bc7b5f8..cec693d 100644 --- a/spec/unit/pool_manager_spec.rb +++ b/spec/unit/pool_manager_spec.rb @@ -36,6 +36,16 @@ EOT subject { Vmpooler::PoolManager.new(config, logger, redis, metrics) } + describe '#config' do + before do + expect(subject).not_to be_nil + end + + it 'should return the current configuration' do + expect(subject.config).to eq(config) + end + end + describe '#check_pending_vm' do before do expect(subject).not_to be_nil