2021-06-14 12:47:05 +00:00
|
|
|
require "helper"
|
|
|
|
require "inspec/resource"
|
|
|
|
require "inspec/resources/mongodb_conf"
|
|
|
|
|
|
|
|
describe "Inspec::Resources::MongodbConf" do
|
|
|
|
it "verify mongd.conf config parsing" do
|
|
|
|
resource = load_resource("mongodb_conf", "/etc/mongod.conf")
|
|
|
|
_(resource.params["storage"]["dbPath"]).must_equal "/var/lib/mongodb"
|
|
|
|
_(resource.params["systemLog"]["path"]).must_equal "/var/log/mongodb/mongod.log"
|
2021-06-15 14:34:00 +00:00
|
|
|
_(resource.params["net"]["port"]).must_equal 27017
|
2021-06-14 12:47:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "verify mongd.conf config parsing use default configuration file location." do
|
|
|
|
resource = load_resource("mongodb_conf")
|
|
|
|
_(resource.params["storage"]["dbPath"]).must_equal "/var/lib/mongodb"
|
|
|
|
_(resource.params["systemLog"]["path"]).must_equal "/var/log/mongodb/mongod.log"
|
|
|
|
end
|
|
|
|
end
|