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

Add tests for configure mixed elevation #4487

Merged
merged 14 commits into from
Jun 14, 2024
Prev Previous commit
fix definition
  • Loading branch information
ryfu-msft committed Jun 7, 2024
commit 8481a79e992ae5738c90b90599290c2c60cef5b4
12 changes: 6 additions & 6 deletions src/AppInstallerCLICore/ConfigurationDynamicRuntimeFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting
{
namespace anonymous
{
#ifndef DISABLE_TEST_HOOKS
#ifndef AICLI_DISABLE_TEST_HOOKS
constexpr std::wstring_view EnableTestModeTestGuid = L"1e62d683-2999-44e7-81f7-6f8f35e8d731";
constexpr std::wstring_view ForceHighIntegrityLevelUnitsTestGuid = L"f698d20f-3584-4f28-bc75-28037e08e651";
constexpr std::wstring_view EnableRestrictedIntegrityLevelTestGuid = L"5cae3226-185f-4289-815c-3c089d238dc6";
Expand Down Expand Up @@ -48,7 +48,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting

DynamicSetProcessor(IConfigurationSetProcessorFactory defaultRemoteFactory, IConfigurationSetProcessor defaultRemoteSetProcessor, const ConfigurationSet& configurationSet) : m_configurationSet(configurationSet)
{
#ifndef DISABLE_TEST_HOOKS
#ifndef AICLI_DISABLE_TEST_HOOKS
m_enableTestMode = GetConfigurationSetMetadataOverride(m_configurationSet, EnableTestModeTestGuid);
m_enableRestrictedIntegrityLevel = GetConfigurationSetMetadataOverride(m_configurationSet, EnableRestrictedIntegrityLevelTestGuid);
m_forceHighIntegrityLevelUnits = GetConfigurationSetMetadataOverride(m_configurationSet, ForceHighIntegrityLevelUnitsTestGuid);
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting
});

// Create set and unit processor for current unit.
#ifndef DISABLE_TEST_HOOKS
#ifndef AICLI_DISABLE_TEST_HOOKS
Security::IntegrityLevel requiredIntegrityLevel = m_forceHighIntegrityLevelUnits ? Security::IntegrityLevel::High : GetIntegrityLevelForUnit(unit);
#else
Security::IntegrityLevel requiredIntegrityLevel = GetIntegrityLevelForUnit(unit);
Expand All @@ -114,7 +114,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting
}
else if (securityContextLower == L"restricted")
{
#ifndef DISABLE_TEST_HOOKS
#ifndef AICLI_DISABLE_TEST_HOOKS
if (m_enableRestrictedIntegrityLevel)
{
return Security::IntegrityLevel::Medium;
Expand Down Expand Up @@ -217,7 +217,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting
if (integrityLevel == Security::IntegrityLevel::High)
{
bool useRunAs = true;
#ifndef DISABLE_TEST_HOOKS
#ifndef AICLI_DISABLE_TEST_HOOKS
useRunAs = !m_enableTestMode;
#endif

Expand All @@ -236,7 +236,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting
ConfigurationSet m_configurationSet;
std::once_flag m_createUnitSetProcessorsOnce;

#ifndef DISABLE_TEST_HOOKS
#ifndef AICLI_DISABLE_TEST_HOOKS
bool m_enableTestMode = false;
bool m_enableRestrictedIntegrityLevel = false;
bool m_forceHighIntegrityLevelUnits = false;
Expand Down
Loading