Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ members = [
"lib/dsc-lib",
"resources/dism_dsc",
"resources/dscecho",
"resources/filecontent",
"resources/file_dsc",
"resources/osinfo",
"resources/process",
"resources/registry",
Expand Down Expand Up @@ -52,7 +52,7 @@ default-members = [
"lib/dsc-lib",
"resources/dism_dsc",
"resources/dscecho",
"resources/filecontent",
"resources/file_dsc",
"resources/osinfo",
"resources/process",
"resources/registry",
Expand Down Expand Up @@ -88,7 +88,7 @@ Windows = [
"lib/dsc-lib",
"resources/dism_dsc",
"resources/dscecho",
"resources/filecontent",
"resources/file_dsc",
"resources/osinfo",
"resources/process",
"resources/registry",
Expand Down Expand Up @@ -116,7 +116,7 @@ macOS = [
"lib/dsc-lib-telemetry",
"lib/dsc-lib",
"resources/dscecho",
"resources/filecontent",
"resources/file_dsc",
"resources/osinfo",
"resources/process",
"resources/runcommandonset",
Expand All @@ -138,7 +138,7 @@ Linux = [
"lib/dsc-lib-telemetry",
"lib/dsc-lib",
"resources/dscecho",
"resources/filecontent",
"resources/file_dsc",
"resources/osinfo",
"resources/process",
"resources/runcommandonset",
Expand All @@ -160,7 +160,7 @@ strip = "symbols" # See split-debuginfo - allows us to drop the size b

[workspace.dependencies]
#external dependencies
# filecontent
# file_dsc
base16ct = { version = "1.0.0", features = ["alloc"] }
# dsc-lib
base32 = { version = "0.5" }
Expand Down Expand Up @@ -238,7 +238,7 @@ semver = { version = "1.0.28" }
serde = { version = "1.0.229", features = ["derive"] }
# dsc, dsc-lib, dscecho, dsc-lib-osinfo, osinfo, process, registry, dsc-lib-registry, runcommandonset, sshdconfig, dsctest, test_group_resource, y2j
serde_json = { version = "1.0.151", features = ["preserve_order"] }
# filecontent
# file_dsc
sha2 = { version = "0.11.0" }
# dsc, dsc-lib, y2j
serde_yaml = { version = "0.9" }
Expand Down
20 changes: 10 additions & 10 deletions data.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dsc-bicep-ext",
"dscecho",
"echo.dsc.resource.json",
"filecontent",
"filecontent.dsc.resource.json",
"file_dsc",
"file_dsc.dsc.manifests.json",
"assertion.dsc.resource.json",
"apt.dsc.resource.json",
"apt.dsc.resource.sh",
Expand Down Expand Up @@ -43,8 +43,8 @@
"dsc-bicep-ext",
"dscecho",
"echo.dsc.resource.json",
"filecontent",
"filecontent.dsc.resource.json",
"file_dsc",
"file_dsc.dsc.manifests.json",
"assertion.dsc.resource.json",
"brew.dsc.resource.json",
"brew.dsc.resource.sh",
Expand Down Expand Up @@ -78,8 +78,8 @@
"dsc-bicep-ext.exe",
"dscecho.exe",
"echo.dsc.resource.json",
"filecontent.exe",
"filecontent.dsc.resource.json",
"file_dsc.exe",
"file_dsc.dsc.manifests.json",
"environment_variable.exe",
"environment_variable.dsc.manifests.json",
"assertion.dsc.resource.json",
Expand Down Expand Up @@ -344,16 +344,16 @@
}
},
{
"Name": "filecontent",
"Name": "file_dsc",
"Kind": "Resource",
"RelativePath": "resources/filecontent",
"RelativePath": "resources/file_dsc",
"IsRust": true,
"Binaries": [
"filecontent"
"file_dsc"
],
"CopyFiles": {
"All": [
"filecontent.dsc.resource.json"
"file_dsc.dsc.manifests.json"
]
}
},
Expand Down
13 changes: 10 additions & 3 deletions dsc/tests/dsc_test_resource_errors.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,33 @@ Describe 'Test resource executable error handling' {

Describe 'Rust resource executable error handling' {
It 'Returns failure when FileContent has no operation' {
$null = filecontent 2>$TestDrive/error.log
$null = file_dsc 2>$TestDrive/error.log

$LASTEXITCODE | Should -Be 1
(Get-Content -Raw $TestDrive/error.log) | Should -Match 'Missing operation'
}

It 'Returns failure when FileContent has no input' {
$null = filecontent get 2>$TestDrive/error.log
$null = file_dsc get 2>$TestDrive/error.log

$LASTEXITCODE | Should -Be 1
(Get-Content -Raw $TestDrive/error.log) | Should -Match 'Missing --input argument'
}

It 'Returns failure when FileContent input is invalid JSON' {
$null = filecontent get --input '{invalid' 2>$TestDrive/error.log
$null = file_dsc get --input '{invalid' 2>$TestDrive/error.log

$LASTEXITCODE | Should -Be 2
(Get-Content -Raw $TestDrive/error.log) | Should -Match 'Invalid JSON input'
}

It 'Returns an unknown operation error before parsing ACL input' {
$null = file_dsc acl unknown --input '{invalid' 2>$TestDrive/error.log

$LASTEXITCODE | Should -Be 1
(Get-Content -Raw $TestDrive/error.log) | Should -Match "Unknown ACL operation: 'unknown'"
}

It 'Returns failure when DSC Echo input is invalid JSON' {
$null = dscecho --input '{invalid' 2>$TestDrive/error.log

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"Name": "filecontent",
"Name": "file_dsc",
"Kind": "Resource",
"IsRust": true,
"Binaries": [
"filecontent"
"file_dsc"
],
"CopyFiles": {
"All": [
"filecontent.dsc.resource.json"
"file_dsc.dsc.manifests.json"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "filecontent"
name = "file_dsc"
version = "0.1.0"
edition = "2024"

[[bin]]
name = "filecontent"
name = "file_dsc"
path = "src/main.rs"

[package.metadata.i18n]
Expand All @@ -18,3 +18,6 @@ rust-i18n = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }

[target.'cfg(windows)'.dependencies]
windows = { workspace = true }
Loading
Loading