Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated upload/download artifact to v4 - Changed test reporting action #701

Merged
merged 42 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
23fb57d
Fixed logs artifact to be unique to prevent clobbering
AhmedBM May 28, 2024
d59818b
added remediation for both scenarios, re-order get/set
AhmedBM May 28, 2024
dd68ae8
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi May 28, 2024
252a884
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi May 29, 2024
cd549e4
Added remediation tag to artifact names
AhmedBM May 29, 2024
bb3dd38
Fixed Set
AhmedBM May 29, 2024
8444d9a
addressed comments
AhmedBM May 29, 2024
34912dd
Fixed artifact naming
AhmedBM May 29, 2024
d1a9c1e
Swapped test reporting to use EnricoMi/publish-unit-test-result-action
AhmedBM May 30, 2024
06dd6e2
cleanup test results
AhmedBM May 30, 2024
c91216a
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi May 30, 2024
421ec24
Merge branch 'ahbenmes/fix_clobbered_artifacts_logs' of https://githu…
MariusNi May 30, 2024
5f6918e
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 4, 2024
18912aa
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 4, 2024
1655f94
fixed permissions on report
AhmedBM Jun 5, 2024
bb86304
updated build-infra image
AhmedBM Jun 5, 2024
3adb27a
Changed test report permissions
AhmedBM Jun 5, 2024
b84c7de
fixed test report
AhmedBM Jun 5, 2024
332003b
fixed report
AhmedBM Jun 6, 2024
337f901
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 6, 2024
e5c454a
Added chmod for logs
AhmedBM Jun 6, 2024
1b0cd43
chmod changes
AhmedBM Jun 6, 2024
e7cbeda
fixed permissions
AhmedBM Jun 6, 2024
3de2ece
chmod instead of chown
AhmedBM Jun 6, 2024
a467736
Merge branch 'ahbenmes/fix_clobbered_artifacts_logs' of https://githu…
MariusNi Jun 6, 2024
237fccc
Test run with /var/log/ log files access restriction temporarily removed
MariusNi Jun 6, 2024
8e57527
One more try
MariusNi Jun 6, 2024
f1e7f5f
Work in progress
MariusNi Jun 6, 2024
b988975
Work in progress
MariusNi Jun 6, 2024
e0d3fc3
Work in progress
MariusNi Jun 6, 2024
47c09ee
Work in progress
MariusNi Jun 6, 2024
e3ffb1f
Work in progress
MariusNi Jun 6, 2024
b8bc786
Work in progress
MariusNi Jun 6, 2024
b065b68
Work in progress
MariusNi Jun 6, 2024
6b69369
Work in progress
MariusNi Jun 6, 2024
65fbf3d
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 6, 2024
724fa3a
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 6, 2024
09a9d77
Work in progress
MariusNi Jun 6, 2024
5c58ddf
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 7, 2024
1421143
Work in progress
MariusNi Jun 7, 2024
8261b58
Restoring temporary changes
MariusNi Jun 7, 2024
5b32cc4
Merge branch 'main' of https://github.com/Azure/azure-osconfig into a…
MariusNi Jun 7, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/universalnrp-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,5 @@ jobs:
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: universal-nrp-test-${{ inputs.target }}-${{ inputs.install-osconfig == true && 'withOSConfig' || 'withoutOSConfig' }}-logs
name: universal-nrp-test-${{ inputs.target }}-${{ steps.normalize.outputs.policyPackage }}-${{ inputs.install-osconfig == true && 'withOSConfig' || 'withoutOSConfig' }}-logs
path: osconfig-logs/osconfig*
7 changes: 4 additions & 3 deletions .github/workflows/universalnrp-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ jobs:
]
policy-package:
[
{ path: LinuxSshServerSecurityBaselinePolicy.zip, skip-remediation: false, resource-count: 20 },
{ path: LinuxSecurityBaselinePolicy.zip, skip-remediation: true, resource-count: 168 },
{ path: LinuxSshServerSecurityBaselinePolicy.zip, resource-count: 20 },
{ path: LinuxSecurityBaselinePolicy.zip, resource-count: 168 },
]
arch: [amd64]
install-osconfig: [false]
skip-remediation: [true, false]
with:
target: ${{ matrix.target.os }}-${{ matrix.target.version }}
arch: ${{ matrix.arch }}
package-type: ${{ matrix.target.package-type }}
policy-package: ${{ matrix.policy-package.path }}
resource-count: ${{ matrix.policy-package.resource-count }}
skip-remediation: ${{ matrix.policy-package.skip-remediation }}
skip-remediation: ${{ matrix.skip-remediation }}
install-osconfig: ${{ matrix.install-osconfig }}
tag: ${{ matrix.target.tag }}
34 changes: 17 additions & 17 deletions src/tests/universal-nrp-e2e/UniversalNRP.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ param (
)

Describe 'Validate Universal NRP' {
# Perform monitoring - Get
Context "Get" {
# Perform Remediation - Set
Context "Set" -Skip:$SkipRemediation {
BeforeAll {
Start-GuestConfigurationPackageRemediation -Path $PolicyPackage
# Wait for remediation to complete
Start-Sleep -Seconds 30
$result = Get-GuestConfigurationPackageComplianceStatus -Path $PolicyPackage
}

Expand All @@ -27,25 +30,26 @@ Describe 'Validate Universal NRP' {
$instance.complianceStatus | Should -BeTrue
}
elseif ($instance.properties.Reasons.Code -eq "FAIL") {
$instance.complianceStatus | Should -BeFalse
throw "There should not be any failing resources after remediation"
}
else {
throw "Reasons are not properly populated"
}
}
}

It 'Ensure all resource instances have status' {
$result.resources.complianceStatus | Should -Not -BeNullOrEmpty
It 'Ensure all resource instances pass audit' {
$result.resources.complianceStatus | Should -BeTrue
}

It 'Ensure overall audit pass' {
$result.complianceStatus | Should -BeTrue
}
}

# Perform Remediation - Set
Context "Set" -Skip:$SkipRemediation {
# Perform monitoring - Get
Context "Get" {
BeforeAll {
Start-GuestConfigurationPackageRemediation -Path $PolicyPackage
# Wait for remediation to complete
Start-Sleep -Seconds 30
$result = Get-GuestConfigurationPackageComplianceStatus -Path $PolicyPackage
}

Expand All @@ -59,20 +63,16 @@ Describe 'Validate Universal NRP' {
$instance.complianceStatus | Should -BeTrue
}
elseif ($instance.properties.Reasons.Code -eq "FAIL") {
throw "There should not be any failing resources after remediation"
$instance.complianceStatus | Should -BeFalse
}
else {
throw "Reasons are not properly populated"
}
}
}

It 'Ensure all resource instances pass audit' {
$result.resources.complianceStatus | Should -BeTrue
}

It 'Ensure overall audit pass' {
$result.complianceStatus | Should -BeTrue
It 'Ensure all resource instances have status' {
$result.resources.complianceStatus | Should -Not -BeNullOrEmpty
}
}
}
Loading