From ad62830edcdc7f15310819798b1da2a85056e116 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 16 Jan 2024 15:48:49 -0800 Subject: [PATCH] fix osinfo tests due to change to correctly case macOS and don't validate empty input --- dsc_lib/src/dscresources/dscresource.rs | 3 +++ osinfo/tests/osinfo.tests.ps1 | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dsc_lib/src/dscresources/dscresource.rs b/dsc_lib/src/dscresources/dscresource.rs index 83b1649b..ef8c432c 100644 --- a/dsc_lib/src/dscresources/dscresource.rs +++ b/dsc_lib/src/dscresources/dscresource.rs @@ -62,6 +62,9 @@ impl DscResource { } fn validate_input(&self, input: &str) -> Result<(), DscError> { + if input.len() == 0 { + return Ok(()); + } let Some(manifest) = &self.manifest else { return Err(DscError::MissingManifest(self.type_name.clone())); }; diff --git a/osinfo/tests/osinfo.tests.ps1 b/osinfo/tests/osinfo.tests.ps1 index 6b9e8301..3148dffd 100644 --- a/osinfo/tests/osinfo.tests.ps1 +++ b/osinfo/tests/osinfo.tests.ps1 @@ -12,7 +12,7 @@ Describe 'osinfo resource tests' { $out.actualState.family | Should -BeExactly 'Linux' } elseif ($IsMacOS) { - $out.actualState.family | Should -BeExactly 'MacOS' + $out.actualState.family | Should -BeExactly 'macOS' } $out.actualState.version | Should -Not -BeNullOrEmpty @@ -50,7 +50,7 @@ Describe 'osinfo resource tests' { $out.resources[0].properties.family | Should -BeExactly 'Linux' } elseif ($IsMacOS) { - $out.resources[0].properties.family | Should -BeExactly 'MacOS' + $out.resources[0].properties.family | Should -BeExactly 'macOS' } } }