diff --git a/src/Microsoft.PowerShell.Commands.Omi/test/Start-DscConfiguration.Tests.ps1 b/src/Microsoft.PowerShell.Commands.Omi/test/Start-DscConfiguration.Tests.ps1 new file mode 100644 index 0000000000..40bd943ada --- /dev/null +++ b/src/Microsoft.PowerShell.Commands.Omi/test/Start-DscConfiguration.Tests.ps1 @@ -0,0 +1,17 @@ +# Note that omicli must be in PATH and omiserver should be started with +# --ignoreAuthentication option + +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$mof = "$here/assets/sample.mof" +$file = "/tmp/linux.txt" + +Describe "Start-DscConfiguration" { + Import-Module Microsoft.PowerShell.Commands.Omi + + It "Should create file per sample MOF file" { + $s = Start-DscConfiguration -ConfigurationMof $mof | + Where-Object {$_.NAME -eq "ReturnValue"} + $s.VALUE | Should Be "0" + $file | Should Exist + } +} diff --git a/src/Microsoft.PowerShell.Commands.Omi/test/sample.mof b/src/Microsoft.PowerShell.Commands.Omi/test/sample.mof new file mode 100644 index 0000000000..cb2d4b33dd --- /dev/null +++ b/src/Microsoft.PowerShell.Commands.Omi/test/sample.mof @@ -0,0 +1,22 @@ +instance of MSFT_nxFileResource +{ + Contents = "my contents"; + DestinationPath = "/tmp/linux.txt"; + Ensure = "Present"; + Type = "File"; + Owner = "root"; + Group = "root"; + Mode = "644"; + ResourceId = "[MSFT_nxFileResource]File1"; + ModuleName = "nx"; + ModuleVersion = "1.0"; + + +}; + +instance of OMI_ConfigurationDocument +{ + Version="1.0.0"; + +}; +