Skip to content

Commit

Permalink
more test adaptation
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 30, 2025
1 parent e0184bd commit 4dc697b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions service/test/agama/cmdline_args_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@

describe ".read_from" do
it "reads the kernel command line options and return a CmdlineArgs object" do
args = described_class.read_from(File.join(workdir, "/proc/cmdline"))
args = described_class.read_from(File.join(workdir, "/run/agama/cmdline.d/agama"))
expect(args.data["auto"]).to eq("http://mydomain.org/tumbleweed.jsonnet")
end

it "sets #config_url if specified on cmdline" do
args = described_class.read_from(File.join(workdir, "/proc/cmdline"))
args = described_class.read_from(File.join(workdir, "/run/agama/cmdline.d/agama"))
expect(args.config_url).to eql("http://example.org/agama.yaml")
end

it "converts 'true' and 'false' values into booleans" do
args = described_class.read_from(File.join(workdir, "/proc/cmdline"))
args = described_class.read_from(File.join(workdir, "/run/agama/cmdline.d/agama"))
expect(args.data["web"]).to eql({ "ssl" => true })
end

it "converts keys with dots after 'agama.' to hash" do
args = described_class.read_from(File.join(workdir, "/proc/cmdline"))
args = described_class.read_from(File.join(workdir, "/run/agama/cmdline.d/agama"))
# here fixture has agama.web.ssl=true and result is this hash
expect(args.data["web"]).to eq({ "ssl" => true })
end

it "properly parse values that contain '='" do
args = described_class.read_from(File.join(workdir, "/proc/cmdline"))
args = described_class.read_from(File.join(workdir, "/run/agama/cmdline.d/agama"))
expect(args.data["install_url"]).to eq("cd:/?devices=/dev/sr1")
end
end
Expand Down

0 comments on commit 4dc697b

Please sign in to comment.