tests/abiquo_postinst_test.rb in abiquo-installer-tests-20120104 vs tests/abiquo_postinst_test.rb in abiquo-installer-tests-20121023.3

- old
+ new

@@ -8,22 +8,30 @@ class String include Term::ANSIColor end -class TestUtils +class TestUtils + # + # Should return an array of installer profiles + # otherwise the installation is broken + # def self.installer_profiles begin buf = File.read '/etc/abiquo-installer' buf =~ /Installed Profiles:(.*)$/ return eval $1.strip.chomp rescue Exception return nil end end + def self.find_abiquo_property(prop_name, prop_file = "/opt/abiquo/config/abiquo.properties") + File.read(prop_file).lines.find { |l| l.strip.chomp =~ /^#{prop_name}/ } + end + def self.service_on?(service) ENV['LANG'] = 'POSIX' `/sbin/chkconfig --list #{service}` =~ /3:on/ end @@ -39,10 +47,11 @@ def self.abiquo_version return nil if not File.exist?('/etc/abiquo-release') buf = File.read '/etc/abiquo-release' buf =~ /Version:\s*(([0-9]|\.)+).*$/ + puts buf $1 end def self.abiquo_base_dir "/opt/abiquo" @@ -95,9 +104,11 @@ puts "Can't find tests for Abiquo Version #{version}" exit 1 end puts "\n\n" + puts "Abiquo Version #{version.bold} detected" + puts puts "Abiquo Installer Test Suite" puts "---------------------------" puts "" if TestUtils.installer_profiles.include? 'abiquo-monolithic' puts "Testing " + "ABIQUO MONOLITHIC".yellow.bold