Sha256: 942f90046db32d91e6e58cf392f6b73c8844815849dc68ab6b97234997f47adb

Contents?: true

Size: 1.39 KB

Versions: 5

Compression:

Stored size: 1.39 KB

Contents

require 'test_helper'

class SuseTest < ActiveSupport::TestCase

  test "ruby class should be OS" do
    assert_equal Operatingsystem, Suse.first.class
  end

  test "os label for suse" do
    assert_equal "OpenSuse 11.4", operatingsystems(:suse).to_label
  end

  test "pxedir for suse" do
   assert_equal "boot/$arch/loader", operatingsystems(:suse).pxedir
  end

  test "kernel location for 64bit arch suse" do
    host = hosts(:suse)
    assert_equal "boot/OpenSuse-11.4-x86_64-linux", host.os.kernel(host.arch)
  end

  test "initrd location for 64bit arch suse" do
    host = hosts(:suse)
    assert_equal "boot/OpenSuse-11.4-x86_64-initrd", host.os.initrd(host.arch)
  end

  test "pxe prefix for suse" do
    host = hosts(:suse)
    prefix = host.os.pxe_prefix(host.arch)
    assert_equal "boot/OpenSuse-11.4-x86_64", prefix
  end

  test "pxe files for suse" do
    host = hosts(:suse)
    host.medium.operatingsystems << host.os
    host.arch.operatingsystems << host.os

    prefix = host.os.pxe_prefix(host.arch).to_sym

    kernel = { prefix => "http://mirror.isoc.org.il/pub/opensuse/distribution/11.4/repo/oss/boot/x86_64/loader/linux"  }
    initrd = { prefix => "http://mirror.isoc.org.il/pub/opensuse/distribution/11.4/repo/oss/boot/x86_64/loader/initrd" }
    assert host.os.pxe_files(host.medium, host.arch).include?(kernel)
    assert host.os.pxe_files(host.medium, host.arch).include?(initrd)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/test/unit/suse_test.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/test/unit/suse_test.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/test/unit/suse_test.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/test/unit/suse_test.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/test/unit/suse_test.rb