Skip to content

Commit

Permalink
Upgraded mock ubuntu test from 20.04 to 22.04 (#6351)
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
  • Loading branch information
Nik08 committed Jan 3, 2023
1 parent 9c1abfe commit 285b2d0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test/helpers/mock_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MockLoader
macos10_10: { name: "mac_os_x", family: "darwin", release: "10.10.4", arch: nil },
macos10_16: { name: "darwin", family: "darwin", release: "10.16", arch: nil },
ubuntu1404: { name: "ubuntu", family: "debian", release: "14.04", arch: "x86_64" },
ubuntu: { name: "ubuntu", family: "debian", release: "20.04", arch: "x86_64" },
ubuntu: { name: "ubuntu", family: "debian", release: "22.04", arch: "x86_64" },
mint17: { name: "linuxmint", family: "debian", release: "17.3", arch: "x86_64" },
mint18: { name: "linuxmint", family: "debian", release: "18", arch: "x86_64" },
windows: { name: "windows", family: "windows", release: "6.2.9200", arch: "x86_64" },
Expand Down
16 changes: 8 additions & 8 deletions test/unit/profiles/metadata_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def from_yaml(str)
_(m).must_be :supports_platform?, backend
end

it "loads a profile which supports release 20.04" do
m = supports_meta({ "release" => "20.04" })
it "loads a profile which supports release 22.04" do
m = supports_meta({ "release" => "22.04" })
_(m).must_be :supports_platform?, backend
end

Expand All @@ -163,13 +163,13 @@ def from_yaml(str)
_(m).wont_be :supports_platform?, backend
end

it "loads a profile which supports ubuntu 20.04" do
m = supports_meta({ "os-name" => "ubuntu", "release" => "20.04" })
it "loads a profile which supports ubuntu 22.04" do
m = supports_meta({ "os-name" => "ubuntu", "release" => "22.04" })
_(m).must_be :supports_platform?, backend
end

it "loads a profile which supports ubuntu 20.*" do
m = supports_meta({ "os-name" => "ubuntu", "release" => "20.*" })
it "loads a profile which supports ubuntu 22.*" do
m = supports_meta({ "os-name" => "ubuntu", "release" => "22.*" })
_(m).must_be :supports_platform?, backend
end

Expand All @@ -183,8 +183,8 @@ def from_yaml(str)
_(m).wont_be :supports_platform?, backend
end

it "loads a profile which supports ubuntu float 20.04 as parsed by yml" do
m = supports_meta({ "os-name" => "ubuntu", "release" => 20.04 })
it "loads a profile which supports ubuntu float 22.04 as parsed by yml" do
m = supports_meta({ "os-name" => "ubuntu", "release" => 22.04 })
_(m).must_be :supports_platform?, backend
end

Expand Down
2 changes: 1 addition & 1 deletion test/unit/resources/os_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
resource = MockLoader.new(:ubuntu).load_resource("os")
_(resource.name).must_equal "ubuntu"
_(resource.family).must_equal "debian"
_(resource.release).must_equal "20.04"
_(resource.release).must_equal "22.04"
_(resource.arch).must_equal "x86_64"
end

Expand Down
12 changes: 6 additions & 6 deletions test/unit/resources/platform_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
it "verify platform parsing on Ubuntu" do
_(resource.name).must_equal "ubuntu"
_(resource.family).must_equal "debian"
_(resource.release).must_equal "20.04"
_(resource.release).must_equal "22.04"
_(resource.arch).must_equal "x86_64"
end

it "verify platform hash parsing on Ubuntu" do
_(resource[:name]).must_equal "ubuntu"
_(resource[:family]).must_equal "debian"
_(resource[:release]).must_equal "20.04"
_(resource[:release]).must_equal "22.04"
_(resource[:arch]).must_equal "x86_64"
end

Expand Down Expand Up @@ -71,18 +71,18 @@
_(resource).wont_be :supported?, supports
end

it "loads a profile which supports release 20.04" do
it "loads a profile which supports release 22.04" do
supports = [
{ 'os-family': "windows", 'os-name': "windows_2000" },
{ 'os-name': "ubuntu", 'release': "20.04" },
{ 'os-name': "ubuntu", 'release': "22.04" },
]
_(resource).must_be :supported?, supports
end

it "loads a profile which supports release 20.*" do
it "loads a profile which supports release 22.*" do
supports = [
{ 'os-family': "windows", 'os-name': "windows_2000" },
{ 'os-name': "ubuntu", 'release': "20.*" },
{ 'os-name': "ubuntu", 'release': "22.*" },
]
_(resource).must_be :supported?, supports
end
Expand Down
2 changes: 1 addition & 1 deletion test/unit/resources/wmi_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
resource = MockLoader.new(:ubuntu).load_resource("wmi", { class: "win32_service", filter: "name like '%winrm%'" })
_(resource.resource_failed?).must_equal true
_(resource.resource_exception_message)
.must_equal "Resource `wmi` is not supported on platform ubuntu/20.04."
.must_equal "Resource `wmi` is not supported on platform ubuntu/22.04."
_(resource.resource_id).must_equal "win32_service"
end
end

0 comments on commit 285b2d0

Please sign in to comment.