| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | PluginTests.h |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | This file contains shared definitions used in the plugin tests. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #pragma once |
| 16 | |
| 17 | #include "registry.hpp" |
| 18 | #include <wil/resource.h> |
| 19 | constexpr auto c_configKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Lxss\\Test"; |
| 20 | |
| 21 | enum class PluginTestType |
| 22 | { |
| 23 | Invalid, |
| 24 | Success, |
| 25 | FailToLoad, |
| 26 | FailToStartVm, |
| 27 | FailToStartDistro, |
| 28 | FailToStopVm, |
| 29 | FailToStopDistro, |
| 30 | ApiErrors, |
| 31 | PluginError, |
| 32 | PluginRequiresUpdate, |
| 33 | SameDistroId, |
| 34 | ErrorMessageStartVm, |
| 35 | ErrorMessageStartDistro, |
| 36 | FailToStartVmWithPluginErrorMessage, |
| 37 | InitPidIsDifferent, |
| 38 | FailToRegisterUnregisterDistro, |
| 39 | RunDistroCommand, |
| 40 | GetUsername, |
| 41 | WslcSuccess, |
| 42 | WslcSessionRejected, |
| 43 | WslcContainerRejected, |
| 44 | WslcImagePull, |
| 45 | WslcVmRestart, |
| 46 | WslcVmStopCommitted, |
| 47 | WslcVmNeverStarted |
| 48 | }; |
| 49 | |
| 50 | constexpr auto c_testType = L"TestType"; |
| 51 | constexpr auto c_logFile = L"LogFile"; |
| 52 | |
| 53 | inline wil::unique_hkey OpenTestRegistryKey(REGSAM AccessMask) |
| 54 | { |
| 55 | return wsl::windows::common::registry::CreateKey(HKEY_LOCAL_MACHINE, c_configKey, AccessMask, nullptr, REG_OPTION_VOLATILE); |
| 56 | } |