2015-03-02 14:28:34 +01:00
|
|
|
require "spec_helper"
|
|
|
|
|
|
|
|
describe Facter::Util::Fact do
|
|
|
|
before {
|
|
|
|
Facter.clear
|
|
|
|
}
|
|
|
|
|
|
|
|
describe "mysql_server_id" do
|
|
|
|
context "igalic's laptop" do
|
|
|
|
before :each do
|
2015-03-04 11:56:32 +01:00
|
|
|
Facter.fact(:macaddress).stubs(:value).returns('3c:97:0e:69:fb:e1')
|
2015-03-02 14:28:34 +01:00
|
|
|
end
|
|
|
|
it do
|
|
|
|
Facter.fact(:mysql_server_id).value.to_s.should == '72898961'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "node with lo only" do
|
|
|
|
before :each do
|
2015-03-04 11:56:32 +01:00
|
|
|
Facter.fact(:macaddress).stubs(:value).returns('00:00:00:00:00:00')
|
2015-03-02 14:28:34 +01:00
|
|
|
end
|
|
|
|
it do
|
2015-03-04 11:56:32 +01:00
|
|
|
Facter.fact(:mysql_server_id).value.to_s.should == '0'
|
2015-03-02 14:28:34 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|