Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Running tests with least privlege #66

Closed
kjacobsen opened this issue Jul 17, 2016 · 3 comments
Closed

Running tests with least privlege #66

kjacobsen opened this issue Jul 17, 2016 · 3 comments
Labels
duplicate The issue or PR is the duplicate of another.

Comments

@kjacobsen
Copy link

Hi,

When running in an environment of least privilege, you cannot run DSC tests making use of TestHelper.psm1.

The helper attempts to make registry changes on line 373. My analysis seems to show that we don't need to make this change at a system level, for all future executions of PowerShell. My recommendation is to remove like 373. If removal cannot occur, then place the correct # requires statement to ensure that it is executed as an Administrator.

The script modifies the execution policy. Once again this creates issues on multiple levels. This logic should be removed, and recommendations made on how the environment should be setup.

There is also calls to install-module that need to be addressed as well.

@PlagueHO
Copy link
Contributor

Hi there. The reason for the system level changes to the PSModulePath is so that the integration tests can run. The LCM runs under a different context than the user initiating the tests. So this is currently the only way to ensure that the module being integration tested can be found.

That being said, this isn't necessary for unit tests. There is already an issue open for correcting this.

@PlagueHO
Copy link
Contributor

Issue #58 is the one open for resolving this. Feel free to submit a PR For it 😄

@KarolKaczmarek
Copy link
Contributor

Thanks for feedback, as @PlagueHO noticed, this is duplicate of #58, so I'll close it for now.
Feel free to reply in #58 if you have further comments.
Thanks!

@KarolKaczmarek KarolKaczmarek added the duplicate The issue or PR is the duplicate of another. label Jul 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate The issue or PR is the duplicate of another.
Projects
None yet
Development

No branches or pull requests

3 participants