| 1 |
# When App Control is not enabled we expect modules even if signed or unsigned should |
| 2 |
# run without any changes in FullLanguageMode. |
| 3 |
|
| 4 |
- name: run signed module |
| 5 |
ns.col.signed: |
| 6 |
input: café |
| 7 |
register: signed_res |
| 8 |
|
| 9 |
- name: assert run signed module |
| 10 |
assert: |
| 11 |
that: |
| 12 |
- signed_res.language_mode == 'FullLanguage' |
| 13 |
- signed_res.test == 'signed' |
| 14 |
- signed_res.whoami == current_user |
| 15 |
- signed_res.ünicode == 'café' |
| 16 |
|
| 17 |
- name: run inline signed module |
| 18 |
ns.col.inline_signed: |
| 19 |
input: café |
| 20 |
register: inline_signed_res |
| 21 |
|
| 22 |
- name: assert run inline signed module |
| 23 |
assert: |
| 24 |
that: |
| 25 |
- inline_signed_res.language_mode == 'FullLanguage' |
| 26 |
- inline_signed_res.test == 'inline_signed' |
| 27 |
- inline_signed_res.whoami == current_user |
| 28 |
- inline_signed_res.ünicode == 'café' |
| 29 |
|
| 30 |
- name: run inline signed module that is not trusted |
| 31 |
ns.col.inline_signed_not_trusted: |
| 32 |
input: café |
| 33 |
register: inline_signed_not_trusted_res |
| 34 |
|
| 35 |
- name: assert run inline signed module |
| 36 |
assert: |
| 37 |
that: |
| 38 |
- inline_signed_not_trusted_res.language_mode == 'FullLanguage' |
| 39 |
- inline_signed_not_trusted_res.test == 'inline_signed_not_trusted' |
| 40 |
- inline_signed_not_trusted_res.whoami == current_user |
| 41 |
- inline_signed_not_trusted_res.ünicode == 'café' |
| 42 |
|
| 43 |
- name: run signed module to test exec wrapper scope |
| 44 |
ns.col.scope: |
| 45 |
register: scoped_res |
| 46 |
|
| 47 |
- name: assert run signed module to test exec wrapper scope |
| 48 |
assert: |
| 49 |
that: |
| 50 |
- scoped_res.missing_using_namespace == True |
| 51 |
- scoped_res.module_using_namespace == 'System.Management.Automation.Language.Parser' |
| 52 |
- scoped_res.script_var == 'foo' |
| 53 |
|
| 54 |
- name: run module marked as skipped |
| 55 |
ns.col.skipped: |
| 56 |
input: café |
| 57 |
register: skipped_res |
| 58 |
|
| 59 |
- name: assert run module marked as skipped |
| 60 |
assert: |
| 61 |
that: |
| 62 |
- skipped_res.language_mode == 'FullLanguage' |
| 63 |
- skipped_res.test == 'skipped' |
| 64 |
- skipped_res.whoami == current_user |
| 65 |
- skipped_res.ünicode == 'café' |
| 66 |
|
| 67 |
- name: run module marked as unsupported |
| 68 |
ns.col.unsupported: |
| 69 |
register: unsupported_res |
| 70 |
|
| 71 |
- name: assert run module marked as unsupported |
| 72 |
assert: |
| 73 |
that: |
| 74 |
- unsupported_res.language_mode == 'FullLanguage' |
| 75 |
- unsupported_res.test == 'unsupported' |
| 76 |
- unsupported_res.whoami == current_user |
| 77 |
|
| 78 |
- name: run module with signed utils |
| 79 |
ns.col.signed_module_util: |
| 80 |
register: signed_util_res |
| 81 |
|
| 82 |
- name: assert run module with signed utils |
| 83 |
assert: |
| 84 |
that: |
| 85 |
- signed_util_res.language_mode == 'FullLanguage' |
| 86 |
- signed_util_res.builtin_powershell_util == 'value' |
| 87 |
- signed_util_res.csharp_util == 'value' |
| 88 |
- signed_util_res.powershell_util.language_mode == 'FullLanguage' |
| 89 |
|
| 90 |
- name: run module with unsigned C# util |
| 91 |
ns.col.unsigned_csharp_util: |
| 92 |
register: unsigned_csharp_util_res |
| 93 |
|
| 94 |
- name: assert run module with unsigned C# util |
| 95 |
assert: |
| 96 |
that: |
| 97 |
- unsigned_csharp_util_res.language_mode == 'FullLanguage' |
| 98 |
- unsigned_csharp_util_res.res == 'value' |
| 99 |
|
| 100 |
- name: run module with unsigned Pwsh util |
| 101 |
ns.col.unsigned_pwsh_util: |
| 102 |
register: unsigned_pwsh_util_res |
| 103 |
|
| 104 |
- name: assert run module with unsigned Pwsh util |
| 105 |
assert: |
| 106 |
that: |
| 107 |
- unsigned_pwsh_util_res.language_mode == 'FullLanguage' |
| 108 |
- unsigned_pwsh_util_res.res.language_mode == 'FullLanguage' |
| 109 |
|
| 110 |
- name: run unsigned module with utils |
| 111 |
ns.col.unsigned_module_with_util: |
| 112 |
register: unsigned_module_with_util_res |
| 113 |
|
| 114 |
- name: assert run unsigned module with utils |
| 115 |
assert: |
| 116 |
that: |
| 117 |
- unsigned_module_with_util_res.language_mode == 'FullLanguage' |
| 118 |
- unsigned_module_with_util_res.builtin_csharp == True |
| 119 |
- unsigned_module_with_util_res.builtin_pwsh == True |
| 120 |
- unsigned_module_with_util_res.collection_csharp == True |
| 121 |
- unsigned_module_with_util_res.collection_pwsh == True |
| 122 |
|
| 123 |
- name: run script role |
| 124 |
import_role: |
| 125 |
name: ns.col.app_control_script |
| 126 |
|
| 127 |
- name: assert script role result |
| 128 |
assert: |
| 129 |
that: |
| 130 |
- signed_res.rc == 0 |
| 131 |
- (signed_res.stdout | from_json).language_mode == 'FullLanguage' |
| 132 |
- (signed_res.stdout | from_json).whoami == current_user |
| 133 |
- (signed_res.stdout | from_json).ünicode == 'café' |
| 134 |
- unsigned_res.rc == 0 |
| 135 |
- (unsigned_res.stdout | from_json).language_mode == 'FullLanguage' |
| 136 |
- (unsigned_res.stdout | from_json).whoami == current_user |
| 137 |
- (unsigned_res.stdout | from_json).ünicode == 'café' |
| 138 |
|
| 139 |
- name: run signed module with signed module util in another collection |
| 140 |
ns.module_util_ref.module: |
| 141 |
register: cross_util_res |
| 142 |
|
| 143 |
- name: assert run signed module with signed module utils in another collection |
| 144 |
assert: |
| 145 |
that: |
| 146 |
- cross_util_res.language_mode == 'FullLanguage' |
| 147 |
- cross_util_res.csharp_util == 'value' |
| 148 |
- "cross_util_res.powershell_util == {'language_mode': 'FullLanguage'}" |