2019-06-11 15:24:35 -07:00
|
|
|
require "helper"
|
|
|
|
require "inspec/resource"
|
|
|
|
require "inspec/resources/apt"
|
2015-10-10 19:54:00 +02:00
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
describe "Inspec::Resources::AptRepo" do
|
2015-10-10 19:54:00 +02:00
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on ubuntu" do
|
2021-09-29 12:15:39 +05:30
|
|
|
resource = MockLoader.new(:ubuntu).load_resource("apt", "http://archive.ubuntu.com/ubuntu/")
|
2015-10-10 19:54:00 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on ubuntu with ppa" do
|
2021-09-29 12:15:39 +05:30
|
|
|
resource = MockLoader.new(:ubuntu).load_resource("apt", "ubuntu-wine/ppa")
|
2015-10-10 19:54:00 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on ubuntu with ppa" do
|
2021-09-29 12:15:39 +05:30
|
|
|
resource = MockLoader.new(:ubuntu).load_resource("apt", "ppa:ubuntu-wine/ppa")
|
2015-10-10 19:54:00 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on mint" do
|
|
|
|
resource = MockLoader.new(:mint18).load_resource("apt", "http://archive.ubuntu.com/ubuntu/")
|
2016-10-08 23:26:21 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on mint with ppa" do
|
|
|
|
resource = MockLoader.new(:mint18).load_resource("apt", "ubuntu-wine/ppa")
|
2016-10-08 23:26:21 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on mint with ppa" do
|
|
|
|
resource = MockLoader.new(:mint18).load_resource("apt", "ppa:ubuntu-wine/ppa")
|
2016-10-08 23:26:21 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on debian" do
|
|
|
|
resource = MockLoader.new(:debian8).load_resource("apt", "http://archive.ubuntu.com/ubuntu/")
|
2015-10-10 19:54:00 +02:00
|
|
|
_(resource.exists?).must_equal true
|
|
|
|
_(resource.enabled?).must_equal true
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "check apt on unknown os" do
|
|
|
|
resource = MockLoader.new(:undefined).load_resource("apt", "ubuntu-wine/ppa")
|
2015-10-10 19:54:00 +02:00
|
|
|
_(resource.exists?).must_equal false
|
|
|
|
_(resource.enabled?).must_equal false
|
|
|
|
end
|
|
|
|
end
|