@device-management-toolkit/wsman-messages 5.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +29 -0
  2. package/WSMan.d.ts +217 -0
  3. package/WSMan.js +395 -0
  4. package/WSMan.js.map +1 -0
  5. package/amt/actions.d.ts +112 -0
  6. package/amt/actions.js +118 -0
  7. package/amt/actions.js.map +1 -0
  8. package/amt/classes.d.ts +33 -0
  9. package/amt/classes.js +38 -0
  10. package/amt/classes.js.map +1 -0
  11. package/amt/index.d.ts +12 -0
  12. package/amt/index.js +17 -0
  13. package/amt/index.js.map +1 -0
  14. package/amt/messages.d.ts +466 -0
  15. package/amt/messages.js +819 -0
  16. package/amt/messages.js.map +1 -0
  17. package/amt/messages.test.d.ts +5 -0
  18. package/amt/messages.test.js +1091 -0
  19. package/amt/messages.test.js.map +1 -0
  20. package/amt/methods.d.ts +42 -0
  21. package/amt/methods.js +47 -0
  22. package/amt/methods.js.map +1 -0
  23. package/amt/models.d.ts +329 -0
  24. package/amt/models.js +7 -0
  25. package/amt/models.js.map +1 -0
  26. package/amt/types.d.ts +206 -0
  27. package/amt/types.js +7 -0
  28. package/amt/types.js.map +1 -0
  29. package/cim/actions.d.ts +9 -0
  30. package/cim/actions.js +14 -0
  31. package/cim/actions.js.map +1 -0
  32. package/cim/classes.d.ts +27 -0
  33. package/cim/classes.js +32 -0
  34. package/cim/classes.js.map +1 -0
  35. package/cim/index.d.ts +12 -0
  36. package/cim/index.js +16 -0
  37. package/cim/index.js.map +1 -0
  38. package/cim/messages.d.ts +136 -0
  39. package/cim/messages.js +215 -0
  40. package/cim/messages.js.map +1 -0
  41. package/cim/messages.test.d.ts +5 -0
  42. package/cim/messages.test.js +408 -0
  43. package/cim/messages.test.js.map +1 -0
  44. package/cim/methods.d.ts +15 -0
  45. package/cim/methods.js +20 -0
  46. package/cim/methods.js.map +1 -0
  47. package/cim/models.d.ts +376 -0
  48. package/cim/models.js +7 -0
  49. package/cim/models.js.map +1 -0
  50. package/cim/types.d.ts +296 -0
  51. package/cim/types.js +7 -0
  52. package/cim/types.js.map +1 -0
  53. package/dist +42 -0
  54. package/index.d.ts +9 -0
  55. package/index.js +49 -0
  56. package/index.js.map +1 -0
  57. package/ips/actions.d.ts +15 -0
  58. package/ips/actions.js +20 -0
  59. package/ips/actions.js.map +1 -0
  60. package/ips/classes.d.ts +12 -0
  61. package/ips/classes.js +17 -0
  62. package/ips/classes.js.map +1 -0
  63. package/ips/index.d.ts +12 -0
  64. package/ips/index.js +16 -0
  65. package/ips/index.js.map +1 -0
  66. package/ips/messages.d.ts +117 -0
  67. package/ips/messages.js +210 -0
  68. package/ips/messages.js.map +1 -0
  69. package/ips/messages.test.d.ts +5 -0
  70. package/ips/messages.test.js +206 -0
  71. package/ips/messages.test.js.map +1 -0
  72. package/ips/methods.d.ts +21 -0
  73. package/ips/methods.js +26 -0
  74. package/ips/methods.js.map +1 -0
  75. package/ips/models.d.ts +59 -0
  76. package/ips/models.js +7 -0
  77. package/ips/models.js.map +1 -0
  78. package/ips/types.d.ts +58 -0
  79. package/ips/types.js +7 -0
  80. package/ips/types.js.map +1 -0
  81. package/models/common.d.ts +104 -0
  82. package/models/common.js +7 -0
  83. package/models/common.js.map +1 -0
  84. package/models/index.d.ts +6 -0
  85. package/models/index.js +43 -0
  86. package/models/index.js.map +1 -0
  87. package/package.json +41 -0
  88. package/wsman.test.d.ts +5 -0
  89. package/wsman.test.js +479 -0
  90. package/wsman.test.js.map +1 -0
@@ -0,0 +1,1091 @@
1
+ "use strict";
2
+ /*********************************************************************
3
+ * Copyright (c) Intel Corporation 2021
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ **********************************************************************/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const WSMan_1 = require("../WSMan");
8
+ const _1 = require("./");
9
+ describe('AMT Tests', () => {
10
+ let messageId = 0;
11
+ let amtClass = new _1.Messages();
12
+ beforeEach(() => {
13
+ messageId = 0;
14
+ amtClass = new _1.Messages();
15
+ });
16
+ const xmlHeader = '<?xml version="1.0" encoding="utf-8"?>';
17
+ const envelope = '<Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns="http://www.w3.org/2003/05/soap-envelope"><Header><a:Action>';
18
+ const enumerationContext = 'AC070000-0000-0000-0000-000000000000';
19
+ const operationTimeout = 'PT60S';
20
+ const ethernetPortObject = {
21
+ InstanceID: 'Intel(r) AMT Ethernet Port Settings 0',
22
+ ElementName: 'Intel(r) AMT Ethernet Port Settings',
23
+ SharedMAC: true,
24
+ MACAddress: 'a4-ae-11-1c-02-4d',
25
+ LinkIsUp: true,
26
+ LinkPolicy: [
27
+ 1,
28
+ 14,
29
+ 16
30
+ ],
31
+ SharedStaticIp: false,
32
+ SharedDynamicIP: true,
33
+ IpSyncEnabled: true,
34
+ DHCPEnabled: true,
35
+ PhysicalConnectionType: 0
36
+ };
37
+ const mpsServer = {
38
+ AccessInfo: '192.168.0.38',
39
+ InfoFormat: 3,
40
+ Port: 4433,
41
+ AuthMethod: 2,
42
+ Username: 'admin',
43
+ Password: 'eD9J*56Bn7ieEsVR',
44
+ CommonName: '192.168.0.38'
45
+ };
46
+ const bootSettingData = {
47
+ BIOSLastStatus: [2, 0],
48
+ BIOSPause: false,
49
+ BIOSSetup: false,
50
+ BootMediaIndex: 0,
51
+ ConfigurationDataReset: false,
52
+ ElementName: 'Intel(r) AMT Boot Configuration Settings',
53
+ EnforceSecureBoot: false,
54
+ FirmwareVerbosity: 0,
55
+ ForcedProgressEvents: false,
56
+ IDERBootDevice: 0,
57
+ InstanceID: 'Intel(r) AMT:BootSettingData 0',
58
+ LockKeyboard: false,
59
+ LockPowerButton: false,
60
+ LockResetButton: false,
61
+ LockSleepButton: false,
62
+ OptionsCleared: true,
63
+ OwningEntity: 'Intel(r) AMT',
64
+ ReflashBIOS: false,
65
+ SecureErase: false,
66
+ UseIDER: false,
67
+ UseSOL: false,
68
+ UseSafeMode: false,
69
+ UserPasswordBypass: false,
70
+ UEFIBootNumberOfParams: [1],
71
+ UEFIBootParametersArray: [1]
72
+ };
73
+ const trustedRootCert = 'MIIEOzCCAqOgAwIBAgIDAZiFMA0GCSqGSIb3DQEBDAUAMD0xFzAVBgNVBAMTDk1QU1Jvb3QtNjE0ZDg4MRAwDgYDVQQKEwd1bmtub3duMRAwDgYDVQQGEwd1bmtub3duMCAXDTIwMDgyNTE4MzMzN1oYDzIwNTEwODI1MTgzMzM3WjA9MRcwFQYDVQQDEw5NUFNSb290LTYxNGQ4ODEQMA4GA1UEChMHdW5rbm93bjEQMA4GA1UEBhMHdW5rbm93bjCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAOi1jx9L8DG6gBPxd9gmJ6vqQC/F/TBMTJvb3ZAuRbDxUKnxZk3PafyNM6fO8QTL4qZVhvyGEZaIzVePrdJj31aZ93mNY2TJee3/DLRsJUIZHGFufBvi8pgQL+JjE9JmFD5/S2yciHIEVpKmXo1CbGmZGsnb8NRjaQVwB94pI1mg8JFMxyKzU/cUoCBfI+wmeMgBVdOJPNpH2zjC/GxwEFNQaxGe9GHmYbwoeiDeMPo75E/o+Gw6kJm429cuhJBC3KqHevAJj9V2nSUvoO0oxKqzLVkUYcjHEGYjxIvP6a6uo7x9llwfshJsBZ3PE5hucNdWS3dY3GeCqOwcaAQQIj2jULpZ/KlgVAdBK/o5QjE+IIQXCVK9USvktGzz7I5oH98zy8jCFStbGM7PQCo+DEnHn/SANmVbcy3hjzrXC8zf5dvmKiUb2eKnpv+z3FHsi64sVwFqBArB2ipcTM/qv4nEM6uLW1t+7+NB0OyaBmLktJrpb6af7z/EW1QuPIfTcQIDAQABo0IwQDAMBgNVHRMEBTADAQH/MBEGCWCGSAGG+EIBAQQEAwIABzAdBgNVHQ4EFgQUYU2IeTFqWXI1rG+JqZq8eVDO/LMwDQYJKoZIhvcNAQEMBQADggGBANoKIsFOn8/Lrb98DjOP+LUeopoU9KQ70ndreNqchrkPmM61V9IdD9OZiLr/7OY/rLGZwNvkhQYRPUa842Mqjfpr4YcV6HC0j6Zg0lcpxQ5eGGBkLb/teBcboi3sZcJvbCFUW2DJjhy7uqYxzE4eqSsKx5fEjp/wa6oNzNrgWRXyxQlaOo42RjXnOXS7sB0jPrgO0FClL1Xzif06kFHzzyJCVUqzNEJv0ynLgkpzCVdUUfoMM1RcKc3xJes5C0zg64ugj2R9e4VwJfn9W3+rlYS1So1q1jL8w+3qOM7lXyvr8Bdgc5BMvrOvHxzdOnpZmUEJkbKty62e8fYKN+WP7BrpxnzFQSzczX5S0uN4rn0rLO4wxVf2rtnTqIhKKYTsPMRBVEjpbRT1smzPPdINKu5l/Rz/zZS0b5I4yKJrkTYNgoPC/QSq8A9uXZxxQvj6x1bWZJVWywmaqYolEp8NaVHd+JYnlTmr4XpMHm01TPi1laowtY3ZepnKm8I55Ly0JA==';
74
+ describe('AlarmClockService Tests', () => {
75
+ it('should return a valid amt_AlarmClockService ADD_ALARM wsman message', () => {
76
+ const instanceID = 'Instance';
77
+ const elementName = 'Alarm instance name';
78
+ // Start time must be on the minute - seconds must be 00
79
+ const startTime = '2022-12-31T23:59:00Z';
80
+ // The interval is in minutes
81
+ const minutes = 59;
82
+ const hours = 23;
83
+ const days = 1;
84
+ const interval = minutes + hours * 60 + days * 1440;
85
+ const deleteOnCompletion = true;
86
+ let correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService/AddAlarm</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header>`;
87
+ correctResponse +=
88
+ '<Body><p:AddAlarm_INPUT xmlns:p="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService"><p:AlarmTemplate>';
89
+ correctResponse += `<s:InstanceID xmlns:s="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence">${instanceID}</s:InstanceID>`;
90
+ correctResponse += `<s:ElementName xmlns:s="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence">${elementName}</s:ElementName>`;
91
+ correctResponse += `<s:StartTime xmlns:s="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence"><p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">${startTime}</p:Datetime></s:StartTime>`;
92
+ correctResponse += `<s:Interval xmlns:s="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence"><p:Interval xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">P${days}DT${hours}H${minutes}M</p:Interval></s:Interval>`;
93
+ correctResponse += `<s:DeleteOnCompletion xmlns:s="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence">${String(deleteOnCompletion)}</s:DeleteOnCompletion>`;
94
+ correctResponse += '</p:AlarmTemplate></p:AddAlarm_INPUT></Body></Envelope>';
95
+ const response = amtClass.AlarmClockService.AddAlarm({
96
+ InstanceID: instanceID,
97
+ ElementName: elementName,
98
+ StartTime: new Date(startTime),
99
+ Interval: interval,
100
+ DeleteOnCompletion: deleteOnCompletion
101
+ });
102
+ expect(response).toEqual(correctResponse);
103
+ });
104
+ it('should return a valid amt_AlarmClockService GET message ', () => {
105
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
106
+ const response = amtClass.AlarmClockService.Get();
107
+ expect(response).toEqual(correctResponse);
108
+ });
109
+ it('should return a valid amt_AlarmClockService ENUMERATE wsman message', () => {
110
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
111
+ const response = amtClass.AlarmClockService.Enumerate();
112
+ expect(response).toEqual(correctResponse);
113
+ });
114
+ it('should return a valid amt_AlarmClockService PULL wsman message', () => {
115
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
116
+ const response = amtClass.AlarmClockService.Pull(enumerationContext);
117
+ expect(response).toEqual(correctResponse);
118
+ });
119
+ });
120
+ describe('AuditLog Tests', () => {
121
+ it('should return a valid amt_AuditLog GET wsman message', () => {
122
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
123
+ const response = amtClass.AuditLog.Get();
124
+ expect(response).toEqual(correctResponse);
125
+ });
126
+ it('should return a valid amt_AuditLog ENUMERATE wsman message', () => {
127
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
128
+ const response = amtClass.AuditLog.Enumerate();
129
+ expect(response).toEqual(correctResponse);
130
+ });
131
+ it('should return a valid amt_AuditLog PULL wsman message', () => {
132
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
133
+ const response = amtClass.AuditLog.Pull(enumerationContext);
134
+ expect(response).toEqual(correctResponse);
135
+ });
136
+ it('should return a valid amt_AuditLog ReadRecords wsman message', () => {
137
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog/ReadRecords</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:ReadRecords_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog"><h:StartIndex>1</h:StartIndex></h:ReadRecords_INPUT></Body></Envelope>`;
138
+ const response = amtClass.AuditLog.ReadRecords(1);
139
+ expect(response).toEqual(correctResponse);
140
+ });
141
+ it('should return a valid amt_AuditLog ReadRecords wsman message even if startIndex is undefined', () => {
142
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog/ReadRecords</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:ReadRecords_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuditLog"><h:StartIndex>1</h:StartIndex></h:ReadRecords_INPUT></Body></Envelope>`;
143
+ const response = amtClass.AuditLog.ReadRecords();
144
+ expect(response).toEqual(correctResponse);
145
+ });
146
+ });
147
+ describe('AuthorizationService Tests', () => {
148
+ it('should return a valid amt_AuthorizationService GET wsman message', () => {
149
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
150
+ const response = amtClass.AuthorizationService.Get();
151
+ expect(response).toEqual(correctResponse);
152
+ });
153
+ it('should return a valid amt_AuthorizationService ENUMERATE wsman message', () => {
154
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
155
+ const response = amtClass.AuthorizationService.Enumerate();
156
+ expect(response).toEqual(correctResponse);
157
+ });
158
+ it('should return a valid amt_AuthorizationService PULL wsman message', () => {
159
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
160
+ const response = amtClass.AuthorizationService.Pull(enumerationContext);
161
+ expect(response).toEqual(correctResponse);
162
+ });
163
+ it('should return a valid amt_AuthorizationService SET_ADMIN_ACL_ENTRY_EX wsman message', () => {
164
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/SetAdminAclEntryEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:SetAdminAclEntryEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Username>admin</h:Username><h:DigestPassword>P@ssw0rd</h:DigestPassword></h:SetAdminAclEntryEx_INPUT></Body></Envelope>`;
165
+ const response = amtClass.AuthorizationService.SetAdminACLEntryEx('admin', 'P@ssw0rd');
166
+ expect(response).toEqual(correctResponse);
167
+ });
168
+ it('should return a valid amt_AuthorizationService ADD_USER_ACL_ENTRY_EX wsman message using digest', () => {
169
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/AddUserAclEntryEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddUserAclEntryEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:DigestUsername>test</h:DigestUsername><h:DigestPassword>P@ssw0rd</h:DigestPassword><h:AccessPermission>2</h:AccessPermission><h:Realms>3</h:Realms></h:AddUserAclEntryEx_INPUT></Body></Envelope>`;
170
+ const response = amtClass.AuthorizationService.AddUserAclEntryEx(2, [_1.Realms.ADMINISTRATION], 'test', 'P@ssw0rd');
171
+ expect(response).toEqual(correctResponse);
172
+ });
173
+ it('should return a valid amt_AuthorizationService ADD_USER_ACL_ENTRY_EX wsman message using kerberos', () => {
174
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/AddUserAclEntryEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddUserAclEntryEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:KerberosUserSid>64</h:KerberosUserSid><h:AccessPermission>2</h:AccessPermission><h:Realms>3</h:Realms></h:AddUserAclEntryEx_INPUT></Body></Envelope>`;
175
+ const response = amtClass.AuthorizationService.AddUserAclEntryEx(2, [_1.Realms.ADMINISTRATION], undefined, undefined, '64');
176
+ expect(response).toEqual(correctResponse);
177
+ });
178
+ it('should throw an error if the digestUsername is longer than 16 when calling AddUserAclEntryEx', () => {
179
+ expect(() => {
180
+ amtClass.AuthorizationService.AddUserAclEntryEx(2, [_1.Realms.ADMINISTRATION], 'thisusernameistoolong', 'test');
181
+ }).toThrow(WSMan_1.WSManErrors.USERNAME_TOO_LONG);
182
+ });
183
+ it('should throw an error if digest or kerberos credentials are not provided to AddUserAclEntryEx', () => {
184
+ expect(() => {
185
+ amtClass.AuthorizationService.AddUserAclEntryEx(2, [_1.Realms.ADMINISTRATION]);
186
+ }).toThrow(WSMan_1.WSManErrors.MISSING_USER_ACL_ENTRY_INFORMATION);
187
+ expect(() => {
188
+ amtClass.AuthorizationService.AddUserAclEntryEx(2, [_1.Realms.ADMINISTRATION], 'test');
189
+ }).toThrow(WSMan_1.WSManErrors.MISSING_USER_ACL_ENTRY_INFORMATION);
190
+ expect(() => {
191
+ amtClass.AuthorizationService.AddUserAclEntryEx(2, [_1.Realms.ADMINISTRATION], undefined, 'test');
192
+ }).toThrow(WSMan_1.WSManErrors.MISSING_USER_ACL_ENTRY_INFORMATION);
193
+ });
194
+ it('should return a valid amt_AuthorizationService EnumerateUserAclEntries wsman message when startIndex is undefined', () => {
195
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/EnumerateUserAclEntries</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:EnumerateUserAclEntries_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:StartIndex>1</h:StartIndex></h:EnumerateUserAclEntries_INPUT></Body></Envelope>`;
196
+ const response = amtClass.AuthorizationService.EnumerateUserAclEntries();
197
+ expect(response).toEqual(correctResponse);
198
+ });
199
+ it('should return a valid amt_AuthorizationService EnumerateUserAclEntries wsman message when startIndex is not 1', () => {
200
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/EnumerateUserAclEntries</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:EnumerateUserAclEntries_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:StartIndex>50</h:StartIndex></h:EnumerateUserAclEntries_INPUT></Body></Envelope>`;
201
+ const response = amtClass.AuthorizationService.EnumerateUserAclEntries(50);
202
+ expect(response).toEqual(correctResponse);
203
+ });
204
+ it('should return a valid amt_AuthorizationService GetUserAclEntryEx wsman message', () => {
205
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/GetUserAclEntryEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetUserAclEntryEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Handle>1</h:Handle></h:GetUserAclEntryEx_INPUT></Body></Envelope>`;
206
+ const response = amtClass.AuthorizationService.GetUserAclEntryEx(1);
207
+ expect(response).toEqual(correctResponse);
208
+ });
209
+ it('should return a valid amt_AuthorizationService UpdateUserAclEntryEx wsman message using digest', () => {
210
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/UpdateUserAclEntryEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:UpdateUserAclEntryEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Handle>1</h:Handle><h:DigestUsername>test</h:DigestUsername><h:DigestPassword>test123!</h:DigestPassword><h:AccessPermission>2</h:AccessPermission><h:Realms>3</h:Realms></h:UpdateUserAclEntryEx_INPUT></Body></Envelope>`;
211
+ const response = amtClass.AuthorizationService.UpdateUserAclEntryEx(1, 2, [_1.Realms.ADMINISTRATION], 'test', 'test123!');
212
+ expect(response).toEqual(correctResponse);
213
+ });
214
+ it('should return a valid amt_AuthorizationService UpdateUserAclEntryEx wsman message using kerberos', () => {
215
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/UpdateUserAclEntryEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:UpdateUserAclEntryEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Handle>1</h:Handle><h:KerberosUserSid>64</h:KerberosUserSid><h:AccessPermission>2</h:AccessPermission><h:Realms>3</h:Realms></h:UpdateUserAclEntryEx_INPUT></Body></Envelope>`;
216
+ const response = amtClass.AuthorizationService.UpdateUserAclEntryEx(1, 2, [_1.Realms.ADMINISTRATION], undefined, undefined, '64');
217
+ expect(response).toEqual(correctResponse);
218
+ });
219
+ it('should throw an error if digest or kerberos credentials are not provided to UpdateUserAclEntryEx', () => {
220
+ expect(() => {
221
+ amtClass.AuthorizationService.UpdateUserAclEntryEx(1, 2, [_1.Realms.ADMINISTRATION]);
222
+ }).toThrow(WSMan_1.WSManErrors.MISSING_USER_ACL_ENTRY_INFORMATION);
223
+ expect(() => {
224
+ amtClass.AuthorizationService.UpdateUserAclEntryEx(1, 2, [_1.Realms.ADMINISTRATION], 'test');
225
+ }).toThrow(WSMan_1.WSManErrors.MISSING_USER_ACL_ENTRY_INFORMATION);
226
+ expect(() => {
227
+ amtClass.AuthorizationService.UpdateUserAclEntryEx(1, 2, [_1.Realms.ADMINISTRATION], undefined, 'test');
228
+ }).toThrow(WSMan_1.WSManErrors.MISSING_USER_ACL_ENTRY_INFORMATION);
229
+ });
230
+ it('should throw an error if the digestUsername is longer than 16 when calling UpdateUserAclEntryEx', () => {
231
+ expect(() => {
232
+ amtClass.AuthorizationService.UpdateUserAclEntryEx(1, 2, [_1.Realms.ADMINISTRATION], 'thisusernameistoolong', 'test');
233
+ }).toThrow(WSMan_1.WSManErrors.USERNAME_TOO_LONG);
234
+ });
235
+ it('should return a valid amt_AuthorizationService RemoveUserAclEntry wsman message', () => {
236
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/RemoveUserAclEntry</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:RemoveUserAclEntry_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Handle>1</h:Handle></h:RemoveUserAclEntry_INPUT></Body></Envelope>`;
237
+ const response = amtClass.AuthorizationService.RemoveUserAclEntry(1);
238
+ expect(response).toEqual(correctResponse);
239
+ });
240
+ it('should return a valid amt_AuthorizationService GetAdminAclEntry wsman message', () => {
241
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/GetAdminAclEntry</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetAdminAclEntry_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"></h:GetAdminAclEntry_INPUT></Body></Envelope>`;
242
+ const response = amtClass.AuthorizationService.GetAdminAclEntry();
243
+ expect(response).toEqual(correctResponse);
244
+ });
245
+ it('should return a valid amt_AuthorizationService GetAdminAclEntryStatus wsman message', () => {
246
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/GetAdminAclEntryStatus</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetAdminAclEntryStatus_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"></h:GetAdminAclEntryStatus_INPUT></Body></Envelope>`;
247
+ const response = amtClass.AuthorizationService.GetAdminAclEntryStatus();
248
+ expect(response).toEqual(correctResponse);
249
+ });
250
+ it('should return a valid amt_AuthorizationService GetAdminNetAclEntryStatus wsman message', () => {
251
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/GetAdminNetAclEntryStatus</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetAdminNetAclEntryStatus_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"></h:GetAdminNetAclEntryStatus_INPUT></Body></Envelope>`;
252
+ const response = amtClass.AuthorizationService.GetAdminNetAclEntryStatus();
253
+ expect(response).toEqual(correctResponse);
254
+ });
255
+ it('should return a valid amt_AuthorizationService SetAclEnabledState wsman message', () => {
256
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/SetAclEnabledState</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:SetAclEnabledState_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Handle>1</h:Handle><h:Enabled>true</h:Enabled></h:SetAclEnabledState_INPUT></Body></Envelope>`;
257
+ const response = amtClass.AuthorizationService.SetAclEnabledState(1, true);
258
+ expect(response).toEqual(correctResponse);
259
+ });
260
+ it('should return a valid amt_AuthorizationService GetAclEnabledState wsman message', () => {
261
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService/GetAclEnabledState</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetAclEnabledState_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AuthorizationService"><h:Handle>1</h:Handle></h:GetAclEnabledState_INPUT></Body></Envelope>`;
262
+ const response = amtClass.AuthorizationService.GetAclEnabledState(1);
263
+ expect(response).toEqual(correctResponse);
264
+ });
265
+ });
266
+ describe('BootCapabilities Tests', () => {
267
+ it('should return a valid amt_BootCapabilities Get wsman message', () => {
268
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootCapabilities</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
269
+ const response = amtClass.BootCapabilities.Get();
270
+ expect(response).toEqual(correctResponse);
271
+ });
272
+ it('should return a valid amt_BootCapabilities ENUMERATE wsman message', () => {
273
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootCapabilities</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
274
+ const response = amtClass.BootCapabilities.Enumerate();
275
+ expect(response).toEqual(correctResponse);
276
+ });
277
+ it('should return a valid amt_BootCapabilities PULL wsman message', () => {
278
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootCapabilities</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
279
+ const response = amtClass.BootCapabilities.Pull(enumerationContext);
280
+ expect(response).toEqual(correctResponse);
281
+ });
282
+ });
283
+ describe('BootSettingData Tests', () => {
284
+ it('should return a valid amt_BootSettingData Get wsman message', () => {
285
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
286
+ const response = amtClass.BootSettingData.Get();
287
+ expect(response).toEqual(correctResponse);
288
+ });
289
+ it('should return a valid amt_BootCapabilities ENUMERATE wsman message', () => {
290
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
291
+ const response = amtClass.BootSettingData.Enumerate();
292
+ expect(response).toEqual(correctResponse);
293
+ });
294
+ it('should return a valid AMT_BootSettingData PULL wsman message', () => {
295
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
296
+ const response = amtClass.BootSettingData.Pull(enumerationContext);
297
+ expect(response).toEqual(correctResponse);
298
+ });
299
+ it('should return a valid amt_BootSettingData Put wsman message', () => {
300
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_BootSettingData xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_BootSettingData"><h:BIOSLastStatus>2</h:BIOSLastStatus><h:BIOSLastStatus>0</h:BIOSLastStatus><h:BIOSPause>false</h:BIOSPause><h:BIOSSetup>false</h:BIOSSetup><h:BootMediaIndex>0</h:BootMediaIndex><h:ConfigurationDataReset>false</h:ConfigurationDataReset><h:ElementName>Intel(r) AMT Boot Configuration Settings</h:ElementName><h:EnforceSecureBoot>false</h:EnforceSecureBoot><h:FirmwareVerbosity>0</h:FirmwareVerbosity><h:ForcedProgressEvents>false</h:ForcedProgressEvents><h:IDERBootDevice>0</h:IDERBootDevice><h:InstanceID>Intel(r) AMT:BootSettingData 0</h:InstanceID><h:LockKeyboard>false</h:LockKeyboard><h:LockPowerButton>false</h:LockPowerButton><h:LockResetButton>false</h:LockResetButton><h:LockSleepButton>false</h:LockSleepButton><h:OptionsCleared>true</h:OptionsCleared><h:OwningEntity>Intel(r) AMT</h:OwningEntity><h:ReflashBIOS>false</h:ReflashBIOS><h:SecureErase>false</h:SecureErase><h:UseIDER>false</h:UseIDER><h:UseSOL>false</h:UseSOL><h:UseSafeMode>false</h:UseSafeMode><h:UserPasswordBypass>false</h:UserPasswordBypass><h:UEFIBootNumberOfParams>1</h:UEFIBootNumberOfParams><h:UEFIBootParametersArray>1</h:UEFIBootParametersArray></h:AMT_BootSettingData></Body></Envelope>`;
301
+ const response = amtClass.BootSettingData.Put(bootSettingData);
302
+ expect(response).toEqual(correctResponse);
303
+ });
304
+ });
305
+ describe('EnvironmentDetectionSettingData Tests', () => {
306
+ it('should return a valid amt_EnvironmentDetectionSettingData Get wsman message', () => {
307
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EnvironmentDetectionSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
308
+ const response = amtClass.EnvironmentDetectionSettingData.Get();
309
+ expect(response).toEqual(correctResponse);
310
+ });
311
+ it('should return a valid amt_EnvironmentDetectionSettingData ENUMERATE wsman message', () => {
312
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EnvironmentDetectionSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
313
+ const response = amtClass.EnvironmentDetectionSettingData.Enumerate();
314
+ expect(response).toEqual(correctResponse);
315
+ });
316
+ it('should return a valid amt_EnvironmentDetectionSettingData PULL wsman message', () => {
317
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EnvironmentDetectionSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
318
+ const response = amtClass.EnvironmentDetectionSettingData.Pull(enumerationContext);
319
+ expect(response).toEqual(correctResponse);
320
+ });
321
+ it('should create a valid amt_EnvironmentDetectionSettingData Put wsman message', () => {
322
+ const environmentDetectionSettingData = {
323
+ InstanceID: 'Intel(r) AMT Environment Detection Settings',
324
+ DetectionAlgorithm: 0,
325
+ ElementName: 'Intel(r) AMT Environment Detection Settings',
326
+ DetectionStrings: ['dummy.com']
327
+ };
328
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EnvironmentDetectionSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">${environmentDetectionSettingData.InstanceID}</w:Selector></w:SelectorSet></Header><Body><h:AMT_EnvironmentDetectionSettingData xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EnvironmentDetectionSettingData"><h:InstanceID>${environmentDetectionSettingData.InstanceID}</h:InstanceID><h:DetectionAlgorithm>${environmentDetectionSettingData.DetectionAlgorithm}</h:DetectionAlgorithm><h:ElementName>${environmentDetectionSettingData.ElementName}</h:ElementName><h:DetectionStrings>${environmentDetectionSettingData.DetectionStrings}</h:DetectionStrings></h:AMT_EnvironmentDetectionSettingData></Body></Envelope>`;
329
+ const response = amtClass.EnvironmentDetectionSettingData.Put(environmentDetectionSettingData);
330
+ expect(response).toEqual(correctResponse);
331
+ });
332
+ });
333
+ describe('EthernetPortSettings Tests', () => {
334
+ it('should return a valid amt_EthernetPortSettings Get wsman message', () => {
335
+ const selector = {
336
+ name: 'InstanceID',
337
+ value: 'Intel(r) AMT Ethernet Port Settings 0'
338
+ };
339
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Ethernet Port Settings 0</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
340
+ const response = amtClass.EthernetPortSettings.Get(selector);
341
+ expect(response).toEqual(correctResponse);
342
+ });
343
+ it('should return a valid amt_EthernetPortSettings ENUMERATE wsman message', () => {
344
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
345
+ const response = amtClass.EthernetPortSettings.Enumerate();
346
+ expect(response).toEqual(correctResponse);
347
+ });
348
+ it('should create a valid amt_EthernetPortSettings Pull wsman message', () => {
349
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
350
+ const response = amtClass.EthernetPortSettings.Pull(enumerationContext);
351
+ expect(response).toEqual(correctResponse);
352
+ });
353
+ it('should create a valid amt_EthernetPortSettings Put wsman message', () => {
354
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Ethernet Port Settings 0</w:Selector></w:SelectorSet></Header><Body><h:AMT_EthernetPortSettings xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings"><h:InstanceID>Intel(r) AMT Ethernet Port Settings 0</h:InstanceID><h:ElementName>Intel(r) AMT Ethernet Port Settings</h:ElementName><h:SharedMAC>true</h:SharedMAC><h:MACAddress>a4-ae-11-1c-02-4d</h:MACAddress><h:LinkIsUp>true</h:LinkIsUp><h:LinkPolicy>1</h:LinkPolicy><h:LinkPolicy>14</h:LinkPolicy><h:LinkPolicy>16</h:LinkPolicy><h:SharedStaticIp>false</h:SharedStaticIp><h:SharedDynamicIP>true</h:SharedDynamicIP><h:IpSyncEnabled>true</h:IpSyncEnabled><h:DHCPEnabled>true</h:DHCPEnabled><h:PhysicalConnectionType>0</h:PhysicalConnectionType></h:AMT_EthernetPortSettings></Body></Envelope>`;
355
+ const response = amtClass.EthernetPortSettings.Put(ethernetPortObject);
356
+ expect(response).toEqual(correctResponse);
357
+ });
358
+ it('should remove undefined properties before sending to createBody', () => {
359
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Ethernet Port Settings 0</w:Selector></w:SelectorSet></Header><Body><h:AMT_EthernetPortSettings xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_EthernetPortSettings"><h:InstanceID>Intel(r) AMT Ethernet Port Settings 0</h:InstanceID><h:ElementName>Intel(r) AMT Ethernet Port Settings</h:ElementName><h:SharedMAC>true</h:SharedMAC><h:MACAddress>a4-ae-11-1c-02-4d</h:MACAddress><h:LinkIsUp>true</h:LinkIsUp><h:LinkPolicy>1</h:LinkPolicy><h:LinkPolicy>14</h:LinkPolicy><h:LinkPolicy>16</h:LinkPolicy><h:SharedStaticIp>false</h:SharedStaticIp><h:SharedDynamicIP>true</h:SharedDynamicIP><h:IpSyncEnabled>true</h:IpSyncEnabled><h:DHCPEnabled>true</h:DHCPEnabled><h:PhysicalConnectionType>0</h:PhysicalConnectionType></h:AMT_EthernetPortSettings></Body></Envelope>`;
360
+ const testBody = {
361
+ InstanceID: 'Intel(r) AMT Ethernet Port Settings 0',
362
+ ElementName: 'Intel(r) AMT Ethernet Port Settings',
363
+ SharedMAC: true,
364
+ MACAddress: 'a4-ae-11-1c-02-4d',
365
+ LinkIsUp: true,
366
+ LinkPolicy: [
367
+ 1,
368
+ 14,
369
+ 16
370
+ ],
371
+ SharedStaticIp: false,
372
+ SharedDynamicIP: true,
373
+ DefaultGateway: undefined,
374
+ IpSyncEnabled: true,
375
+ DHCPEnabled: true,
376
+ PhysicalConnectionType: 0,
377
+ IPAddress: undefined,
378
+ SubnetMask: undefined,
379
+ PrimaryDNS: undefined,
380
+ SecondaryDNS: undefined
381
+ };
382
+ const response = amtClass.EthernetPortSettings.Put(testBody);
383
+ expect(response).toEqual(correctResponse);
384
+ });
385
+ });
386
+ describe('GeneralSettings Tests', () => {
387
+ it('should return a valid amt_GeneralSettings Get wsman message', () => {
388
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_GeneralSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
389
+ const response = amtClass.GeneralSettings.Get();
390
+ expect(response).toEqual(correctResponse);
391
+ });
392
+ it('should return a valid amt_GeneralSettings ENUMERATE wsman message', () => {
393
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_GeneralSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
394
+ const response = amtClass.GeneralSettings.Enumerate();
395
+ expect(response).toEqual(correctResponse);
396
+ });
397
+ it('should create a valid amt_GeneralSettings Pull wsman message', () => {
398
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_GeneralSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
399
+ const response = amtClass.GeneralSettings.Pull(enumerationContext);
400
+ expect(response).toEqual(correctResponse);
401
+ });
402
+ it('should return a valid amt_GeneralSettings PUT wsman message', () => {
403
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_GeneralSettings</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_GeneralSettings xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_GeneralSettings"></h:AMT_GeneralSettings></Body></Envelope>`;
404
+ const response = amtClass.GeneralSettings.Put({});
405
+ expect(response).toEqual(correctResponse);
406
+ });
407
+ });
408
+ describe('IEEE8021xCredentialContext Tests', () => {
409
+ it('should return a valid amt_8021xCredentialContext GET wsman message', () => {
410
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021xCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
411
+ const response = amtClass.IEEE8021xCredentialContext.Get();
412
+ expect(response).toEqual(correctResponse);
413
+ });
414
+ it('should return a valid amt_8021xCredentialContext ENUMERATE message', () => {
415
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021xCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
416
+ const response = amtClass.IEEE8021xCredentialContext.Enumerate();
417
+ expect(response).toEqual(correctResponse);
418
+ });
419
+ it('should return a valid amt_8021xCredentialContext PULL message', () => {
420
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021xCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
421
+ const response = amtClass.IEEE8021xCredentialContext.Pull(enumerationContext);
422
+ expect(response).toEqual(correctResponse);
423
+ });
424
+ });
425
+ describe('IEEE8021XProfile Tests', () => {
426
+ it('should return a valid amt_8021XProfile GET wsman message', () => {
427
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021XProfile</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
428
+ const response = amtClass.IEEE8021xProfile.Get();
429
+ expect(response).toEqual(correctResponse);
430
+ });
431
+ it('should return a valid amt_8021XProfile ENUMERATE message', () => {
432
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021XProfile</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
433
+ const response = amtClass.IEEE8021xProfile.Enumerate();
434
+ expect(response).toEqual(correctResponse);
435
+ });
436
+ it('should return a valid amt_8021XProfile PULL message', () => {
437
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021XProfile</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
438
+ const response = amtClass.IEEE8021xProfile.Pull(enumerationContext);
439
+ expect(response).toEqual(correctResponse);
440
+ });
441
+ it('should return a valid amt_8021XProfile PUT message', () => {
442
+ const data = {
443
+ ElementName: 'test',
444
+ InstanceID: 'test',
445
+ Enabled: true,
446
+ ActiveInS0: true,
447
+ AuthenticationProtocol: 0,
448
+ RoamingIdentity: 'test',
449
+ Username: 'test',
450
+ Password: 'test',
451
+ Domain: 'test',
452
+ PxeTimeout: 0
453
+ };
454
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021XProfile</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_8021XProfile xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_8021XProfile"><h:ElementName>test</h:ElementName><h:InstanceID>test</h:InstanceID><h:Enabled>true</h:Enabled><h:ActiveInS0>true</h:ActiveInS0><h:AuthenticationProtocol>0</h:AuthenticationProtocol><h:RoamingIdentity>test</h:RoamingIdentity><h:Username>test</h:Username><h:Password>test</h:Password><h:Domain>test</h:Domain><h:PxeTimeout>0</h:PxeTimeout></h:AMT_8021XProfile></Body></Envelope>`;
455
+ const response = amtClass.IEEE8021xProfile.Put(data);
456
+ expect(response).toEqual(correctResponse);
457
+ });
458
+ });
459
+ describe('KerberosSettingData Tests', () => {
460
+ it('should return a valid amt_KerberosSettingData Get wsman message', () => {
461
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
462
+ const response = amtClass.KerberosSettingData.Get();
463
+ expect(response).toEqual(correctResponse);
464
+ });
465
+ it('should return a valid amt_KerberosSettingData Enumerate wsman message', () => {
466
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
467
+ const response = amtClass.KerberosSettingData.Enumerate();
468
+ expect(response).toEqual(correctResponse);
469
+ });
470
+ it('should return a valid amt_KerberosSettingData GetCredentialCacheState wsman message', () => {
471
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData/GetCredentialCacheState</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetCredentialCacheState_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData"></h:GetCredentialCacheState_INPUT></Body></Envelope>`;
472
+ const response = amtClass.KerberosSettingData.GetCredentialCacheState();
473
+ expect(response).toEqual(correctResponse);
474
+ });
475
+ it('should return a valid amt_KerberosSettingData SetCredentialCacheState wsman message', () => {
476
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData/SetCredentialCacheState</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:SetCredentialCacheState_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData"></h:SetCredentialCacheState_INPUT></Body></Envelope>`;
477
+ const response = amtClass.KerberosSettingData.SetCredentialCacheState(true);
478
+ expect(response).toEqual(correctResponse);
479
+ });
480
+ it('should return a valid amt_KerberosSettingData Pull wsman message', () => {
481
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_KerberosSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
482
+ const response = amtClass.KerberosSettingData.Pull(enumerationContext);
483
+ expect(response).toEqual(correctResponse);
484
+ });
485
+ });
486
+ describe('ManagementPresenceRemoteSAP Tests', () => {
487
+ it('should return a valid amt_ManagementPresenceRemoteSAP Get wsman message', () => {
488
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
489
+ const response = amtClass.ManagementPresenceRemoteSAP.Get();
490
+ expect(response).toEqual(correctResponse);
491
+ });
492
+ it('should return a valid amt_ManagementPresenceRemoteSAP ENUMERATE wsman message', () => {
493
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
494
+ const response = amtClass.ManagementPresenceRemoteSAP.Enumerate();
495
+ expect(response).toEqual(correctResponse);
496
+ });
497
+ it('should create a valid amt_ManagementPresenceRemoteSAP Pull wsman message', () => {
498
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
499
+ const response = amtClass.ManagementPresenceRemoteSAP.Pull(enumerationContext);
500
+ expect(response).toEqual(correctResponse);
501
+ });
502
+ it('should create a valid amt_ManagementPresenceRemoteSAP Delete wsman message', () => {
503
+ const selector = { name: 'Name', value: 'Intel(r) AMT:Management Presence Server 0' };
504
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="Name">Intel(r) AMT:Management Presence Server 0</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
505
+ const response = amtClass.ManagementPresenceRemoteSAP.Delete(selector);
506
+ expect(response).toEqual(correctResponse);
507
+ });
508
+ });
509
+ describe('MessageLog Tests', () => {
510
+ it('should return a valid amt_MessageLog Get wsman message', () => {
511
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
512
+ const response = amtClass.MessageLog.Get();
513
+ expect(response).toEqual(correctResponse);
514
+ });
515
+ it('should return a valid amt_MessageLog ENUMERATE wsman message', () => {
516
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
517
+ const response = amtClass.MessageLog.Enumerate();
518
+ expect(response).toEqual(correctResponse);
519
+ });
520
+ it('should create a valid amt_MessageLog Pull wsman message', () => {
521
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
522
+ const response = amtClass.MessageLog.Pull(enumerationContext);
523
+ expect(response).toEqual(correctResponse);
524
+ });
525
+ it('should return a valid amt_MessageLog PositionToFirstRecords wsman message', () => {
526
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog/PositionToFirstRecord</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:PositionToFirstRecord_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog" /></Body></Envelope>`;
527
+ const response = amtClass.MessageLog.PositionToFirstRecord();
528
+ expect(response).toEqual(correctResponse);
529
+ });
530
+ it('should return a valid amt_MessageLog GetRecords wsman message', () => {
531
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog/GetRecords</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetRecords_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog"><h:IterationIdentifier>1</h:IterationIdentifier><h:MaxReadRecords>390</h:MaxReadRecords></h:GetRecords_INPUT></Body></Envelope>`;
532
+ const response = amtClass.MessageLog.GetRecords(1);
533
+ expect(response).toEqual(correctResponse);
534
+ });
535
+ it('should return a valid amt_MessageLog GetRecords wsman message even if identifier is undefined', () => {
536
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog/GetRecords</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetRecords_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MessageLog"><h:IterationIdentifier>1</h:IterationIdentifier><h:MaxReadRecords>390</h:MaxReadRecords></h:GetRecords_INPUT></Body></Envelope>`;
537
+ const response = amtClass.MessageLog.GetRecords();
538
+ expect(response).toEqual(correctResponse);
539
+ });
540
+ });
541
+ describe('MPSUsernamePassword Tests', () => {
542
+ it('should return a valid amt_MPSUsernamePassword Get wsman message', () => {
543
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MPSUsernamePassword</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
544
+ const response = amtClass.MPSUsernamePassword.Get();
545
+ expect(response).toEqual(correctResponse);
546
+ });
547
+ it('should return a valid amt_MPSUsernamePassword Enumerate wsman message', () => {
548
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MPSUsernamePassword</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
549
+ const response = amtClass.MPSUsernamePassword.Enumerate();
550
+ expect(response).toEqual(correctResponse);
551
+ });
552
+ it('should return a valid amt_MPSUsernamePassword Pull wsman message', () => {
553
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MPSUsernamePassword</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
554
+ const response = amtClass.MPSUsernamePassword.Pull(enumerationContext);
555
+ expect(response).toEqual(correctResponse);
556
+ });
557
+ it('should return a valid amt_MPSUsernamePassword Put wsman message', () => {
558
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MPSUsernamePassword</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_MPSUsernamePassword xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_MPSUsernamePassword"><h:InstanceID>test</h:InstanceID><h:Secret>test</h:Secret><h:RemoteID>test</h:RemoteID></h:AMT_MPSUsernamePassword></Body></Envelope>`;
559
+ const mpsUsernamePassword = {
560
+ InstanceID: 'test',
561
+ Secret: 'test',
562
+ RemoteID: 'test'
563
+ };
564
+ const response = amtClass.MPSUsernamePassword.Put(mpsUsernamePassword);
565
+ expect(response).toEqual(correctResponse);
566
+ });
567
+ });
568
+ describe('PublicKeyCertificate Tests', () => {
569
+ it('should return a valid amt_PublicKeyCertificate Get wsman message', () => {
570
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
571
+ const response = amtClass.PublicKeyCertificate.Get();
572
+ expect(response).toEqual(correctResponse);
573
+ });
574
+ it('should return a valid amt_PublicKeyCertificate ENUMERATE wsman message', () => {
575
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
576
+ const response = amtClass.PublicKeyCertificate.Enumerate();
577
+ expect(response).toEqual(correctResponse);
578
+ });
579
+ it('should create a valid amt_PublicKeyCertificate Pull wsman message', () => {
580
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
581
+ const response = amtClass.PublicKeyCertificate.Pull(enumerationContext);
582
+ expect(response).toEqual(correctResponse);
583
+ });
584
+ it('should create a valid amt_PublicKeyCertificate Delete wsman message', () => {
585
+ const selector = { name: 'InstanceID', value: 'Intel(r) AMT Certificate: Handle: 0' };
586
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Certificate: Handle: 0</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
587
+ const response = amtClass.PublicKeyCertificate.Delete(selector);
588
+ expect(response).toEqual(correctResponse);
589
+ });
590
+ });
591
+ describe('PublicKeyManagementService Tests', () => {
592
+ it('should return a valid amt_PublicKeyManagementService Get wsman message', () => {
593
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
594
+ const response = amtClass.PublicKeyManagementService.Get();
595
+ expect(response).toEqual(correctResponse);
596
+ });
597
+ it('should return a valid amt_PublicKeyManagementService ENUMERATE wsman message', () => {
598
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
599
+ const response = amtClass.PublicKeyManagementService.Enumerate();
600
+ expect(response).toEqual(correctResponse);
601
+ });
602
+ it('should create a valid amt_PublicKeyManagementService Pull wsman message', () => {
603
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
604
+ const response = amtClass.PublicKeyManagementService.Pull(enumerationContext);
605
+ expect(response).toEqual(correctResponse);
606
+ });
607
+ it('should return a valid amt_PublicKeyManagementService AddTrustedRootCertificate wsman message', () => {
608
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService/AddTrustedRootCertificate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddTrustedRootCertificate_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService"><h:CertificateBlob>${trustedRootCert}</h:CertificateBlob></h:AddTrustedRootCertificate_INPUT></Body></Envelope>`;
609
+ const response = amtClass.PublicKeyManagementService.AddTrustedRootCertificate({
610
+ CertificateBlob: trustedRootCert
611
+ });
612
+ expect(response).toEqual(correctResponse);
613
+ });
614
+ it('should return a valid amt_PublicKeyManagementService GenerateKeyPair wsman message', () => {
615
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService/GenerateKeyPair</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GenerateKeyPair_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService"><h:KeyAlgorithm>0</h:KeyAlgorithm><h:KeyLength>2048</h:KeyLength></h:GenerateKeyPair_INPUT></Body></Envelope>`;
616
+ const keyPairParameters = {
617
+ KeyAlgorithm: 0,
618
+ KeyLength: 2048
619
+ };
620
+ const response = amtClass.PublicKeyManagementService.GenerateKeyPair(keyPairParameters);
621
+ expect(response).toEqual(correctResponse);
622
+ });
623
+ it('should return a valid amt_PublicKeyManagementService AddCertificate wsman message', () => {
624
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService/AddCertificate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddCertificate_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService"><h:CertificateBlob>${trustedRootCert}</h:CertificateBlob></h:AddCertificate_INPUT></Body></Envelope>`;
625
+ const response = amtClass.PublicKeyManagementService.AddCertificate({ CertificateBlob: trustedRootCert });
626
+ expect(response).toEqual(correctResponse);
627
+ });
628
+ it('should return a valid amt_PublicKeyManagementService GeneratePKCS10RequestEx wsman message', () => {
629
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService/GeneratePKCS10RequestEx</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GeneratePKCS10RequestEx_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService"><h:KeyPair>test</h:KeyPair><h:NullSignedCertificateRequest>reallylongcertificateteststring</h:NullSignedCertificateRequest><h:SigningAlgorithm>1</h:SigningAlgorithm></h:GeneratePKCS10RequestEx_INPUT></Body></Envelope>`;
630
+ const pkcs10Request = {
631
+ KeyPair: 'test',
632
+ NullSignedCertificateRequest: 'reallylongcertificateteststring',
633
+ SigningAlgorithm: 1
634
+ };
635
+ const response = amtClass.PublicKeyManagementService.GeneratePKCS10RequestEx(pkcs10Request);
636
+ expect(response).toEqual(correctResponse);
637
+ });
638
+ it('should return a valid amt_PublicKeyManagementService AddKey wsman message', () => {
639
+ const keyBlob = 'testkeyblob';
640
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService/AddKey</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddKey_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyManagementService"><h:KeyBlob>${keyBlob}</h:KeyBlob></h:AddKey_INPUT></Body></Envelope>`;
641
+ const response = amtClass.PublicKeyManagementService.AddKey(keyBlob);
642
+ expect(response).toEqual(correctResponse);
643
+ });
644
+ });
645
+ describe('PublicPrivateKeyPair Tests', () => {
646
+ const selector = {
647
+ name: 'InstanceID',
648
+ value: 'Intel(r) AMT Key: Handle: 0'
649
+ };
650
+ it('should return a valid PublicPrivateKeyPair Get wsman message', () => {
651
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
652
+ const response = amtClass.PublicPrivateKeyPair.Get();
653
+ expect(response).toEqual(correctResponse);
654
+ });
655
+ it('should return a valid PublicPrivateKeyPair ENUMERATE wsman message', () => {
656
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
657
+ const response = amtClass.PublicPrivateKeyPair.Enumerate();
658
+ expect(response).toEqual(correctResponse);
659
+ });
660
+ it('should create a valid PublicPrivateKeyPair Pull wsman message', () => {
661
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
662
+ const response = amtClass.PublicPrivateKeyPair.Pull(enumerationContext);
663
+ expect(response).toEqual(correctResponse);
664
+ });
665
+ it('should return a valid PublicPrivateKeyPair DELETE wsman message', () => {
666
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Key: Handle: 0</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
667
+ const response = amtClass.PublicPrivateKeyPair.Delete(selector);
668
+ expect(response).toEqual(correctResponse);
669
+ });
670
+ });
671
+ describe('RedirectionService Tests', () => {
672
+ it('should return a valid amt_RedirectionService Get wsman message', () => {
673
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
674
+ const response = amtClass.RedirectionService.Get();
675
+ expect(response).toEqual(correctResponse);
676
+ });
677
+ it('should return a valid amt_RedirectionService ENUMERATE wsman message', () => {
678
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
679
+ const response = amtClass.RedirectionService.Enumerate();
680
+ expect(response).toEqual(correctResponse);
681
+ });
682
+ it('should create a valid amt_RedirectionService Pull wsman message', () => {
683
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
684
+ const response = amtClass.RedirectionService.Pull(enumerationContext);
685
+ expect(response).toEqual(correctResponse);
686
+ });
687
+ it('should return a valid amt_BootSettingData Put wsman message', () => {
688
+ const test = {
689
+ Name: 'test',
690
+ CreationClassName: 'test',
691
+ SystemName: 'test',
692
+ SystemCreationClassName: 'test',
693
+ AccessLog: 'test',
694
+ ElementName: 'test',
695
+ EnabledState: 32768,
696
+ ListenerEnabled: true
697
+ };
698
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_RedirectionService xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService"><h:Name>test</h:Name><h:CreationClassName>test</h:CreationClassName><h:SystemName>test</h:SystemName><h:SystemCreationClassName>test</h:SystemCreationClassName><h:AccessLog>test</h:AccessLog><h:ElementName>test</h:ElementName><h:EnabledState>32768</h:EnabledState><h:ListenerEnabled>true</h:ListenerEnabled></h:AMT_RedirectionService></Body></Envelope>`;
699
+ const response = amtClass.RedirectionService.Put(test);
700
+ expect(response).toEqual(correctResponse);
701
+ });
702
+ it('should return a valid amt_BootSettingData REQUEST_STATE_CHANGE wsman message', () => {
703
+ const requestedState = 32771;
704
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService/RequestStateChange</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:RequestStateChange_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService"><h:RequestedState>32771</h:RequestedState></h:RequestStateChange_INPUT></Body></Envelope>`;
705
+ const response = amtClass.RedirectionService.RequestStateChange(requestedState);
706
+ expect(response).toEqual(correctResponse);
707
+ });
708
+ });
709
+ describe('RemoteAccessPolicyAppliesToMPS Tests', () => {
710
+ it('should return a valid amt_RemoteAccessPolicyAppliesToMPS ENUMERATE wsman message', () => {
711
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
712
+ const response = amtClass.RemoteAccessPolicyAppliesToMPS.Enumerate();
713
+ expect(response).toEqual(correctResponse);
714
+ });
715
+ it('should return a valid amt_RemoteAccessPolicyAppliesToMPS DELETE wsman message', () => {
716
+ const selector = {
717
+ name: 'Name',
718
+ value: 'Instance'
719
+ };
720
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="Name">Instance</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
721
+ const response = amtClass.RemoteAccessPolicyAppliesToMPS.Delete(selector);
722
+ expect(response).toEqual(correctResponse);
723
+ });
724
+ it('should return a valid amt_RemoteAccessPolicyAppliesToMPS GET wsman message', () => {
725
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
726
+ const response = amtClass.RemoteAccessPolicyAppliesToMPS.Get();
727
+ expect(response).toEqual(correctResponse);
728
+ });
729
+ it('should create a valid amt_RemoteAccessPolicyAppliesToMPS PULL wsman message', () => {
730
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>AC070000-0000-0000-0000-000000000000</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
731
+ const response = amtClass.RemoteAccessPolicyAppliesToMPS.Pull(enumerationContext);
732
+ expect(response).toEqual(correctResponse);
733
+ });
734
+ it('should create a valid amt_RemoteAccessPolicyAppliesToMPS PUT wsman message', () => {
735
+ const managedElement = {
736
+ ElementName: 'test',
737
+ Description: 'test',
738
+ Caption: 'test'
739
+ };
740
+ const policySet = {
741
+ CommonName: 'test',
742
+ Enabled: 1,
743
+ PolicyDecisionStrategy: 1,
744
+ PolicyKeywords: ['test'],
745
+ PolicyRoles: ['test'],
746
+ Caption: 'test',
747
+ Description: 'test',
748
+ ElementName: 'test'
749
+ };
750
+ const remoteAccessPolicyAppliesToMPS = {
751
+ ManagedElement: managedElement,
752
+ PolicySet: policySet,
753
+ MpsType: 2,
754
+ OrderOfAccess: 0
755
+ };
756
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_RemoteAccessPolicyAppliesToMPS xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS"><h:ManagedElement><h:ElementName>test</h:ElementName><h:Description>test</h:Description><h:Caption>test</h:Caption></h:ManagedElement><h:PolicySet><h:CommonName>test</h:CommonName><h:Enabled>1</h:Enabled><h:PolicyDecisionStrategy>1</h:PolicyDecisionStrategy><h:PolicyKeywords>test</h:PolicyKeywords><h:PolicyRoles>test</h:PolicyRoles><h:Caption>test</h:Caption><h:Description>test</h:Description><h:ElementName>test</h:ElementName></h:PolicySet><h:MpsType>2</h:MpsType><h:OrderOfAccess>0</h:OrderOfAccess></h:AMT_RemoteAccessPolicyAppliesToMPS></Body></Envelope>`;
757
+ const response = amtClass.RemoteAccessPolicyAppliesToMPS.Put(remoteAccessPolicyAppliesToMPS);
758
+ expect(response).toEqual(correctResponse);
759
+ });
760
+ it('should create a valid amt_RemoteAccessPolicyAppliesToMPS CREATE wsman message', () => {
761
+ const managedElement = {
762
+ ElementName: 'test',
763
+ Description: 'test',
764
+ Caption: 'test'
765
+ };
766
+ const policySet = {
767
+ CommonName: 'test',
768
+ Enabled: 1,
769
+ PolicyDecisionStrategy: 1,
770
+ PolicyKeywords: ['test'],
771
+ PolicyRoles: ['test'],
772
+ Caption: 'test',
773
+ Description: 'test',
774
+ ElementName: 'test'
775
+ };
776
+ const remoteAccessPolicyAppliesToMPS = {
777
+ ManagedElement: managedElement,
778
+ PolicySet: policySet,
779
+ MpsType: 2,
780
+ OrderOfAccess: 0
781
+ };
782
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_RemoteAccessPolicyAppliesToMPS xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyAppliesToMPS"><h:ManagedElement><h:ElementName>test</h:ElementName><h:Description>test</h:Description><h:Caption>test</h:Caption></h:ManagedElement><h:PolicySet><h:CommonName>test</h:CommonName><h:Enabled>1</h:Enabled><h:PolicyDecisionStrategy>1</h:PolicyDecisionStrategy><h:PolicyKeywords>test</h:PolicyKeywords><h:PolicyRoles>test</h:PolicyRoles><h:Caption>test</h:Caption><h:Description>test</h:Description><h:ElementName>test</h:ElementName></h:PolicySet><h:MpsType>2</h:MpsType><h:OrderOfAccess>0</h:OrderOfAccess></h:AMT_RemoteAccessPolicyAppliesToMPS></Body></Envelope>`;
783
+ const response = amtClass.RemoteAccessPolicyAppliesToMPS.Create(remoteAccessPolicyAppliesToMPS);
784
+ expect(response).toEqual(correctResponse);
785
+ });
786
+ });
787
+ describe('RemoteAccessPolicyRule Tests', () => {
788
+ it('should return a valid amt_RemoteAccessPolicyRule Get wsman message', () => {
789
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyRule</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
790
+ const response = amtClass.RemoteAccessPolicyRule.Get();
791
+ expect(response).toEqual(correctResponse);
792
+ });
793
+ it('should return a valid amt_RemoteAccessPolicyRule ENUMERATE wsman message', () => {
794
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyRule</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
795
+ const response = amtClass.RemoteAccessPolicyRule.Enumerate();
796
+ expect(response).toEqual(correctResponse);
797
+ });
798
+ it('should create a valid amt_RemoteAccessPolicyRule Pull wsman message', () => {
799
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyRule</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
800
+ const response = amtClass.RemoteAccessPolicyRule.Pull(enumerationContext);
801
+ expect(response).toEqual(correctResponse);
802
+ });
803
+ it('should create a valid amt_RemoteAccessPolicyRule Delete wsman message', () => {
804
+ const selector = { name: 'PolicyRuleName', value: 'User Initiated' };
805
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessPolicyRule</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="PolicyRuleName">User Initiated</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
806
+ const response = amtClass.RemoteAccessPolicyRule.Delete(selector);
807
+ expect(response).toEqual(correctResponse);
808
+ });
809
+ });
810
+ describe('RemoteAccessService Tests', () => {
811
+ it('should return a valid amt_RemoteAccessService Get wsman message', () => {
812
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
813
+ const response = amtClass.RemoteAccessService.Get();
814
+ expect(response).toEqual(correctResponse);
815
+ });
816
+ it('should return a valid amt_RemoteAccessService ENUMERATE wsman message', () => {
817
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
818
+ const response = amtClass.RemoteAccessService.Enumerate();
819
+ expect(response).toEqual(correctResponse);
820
+ });
821
+ it('should create a valid amt_RemoteAccessService Pull wsman message', () => {
822
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
823
+ const response = amtClass.RemoteAccessService.Pull(enumerationContext);
824
+ expect(response).toEqual(correctResponse);
825
+ });
826
+ it('should return a valid amt_RemoteAccessService addMpsServer wsman message', () => {
827
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService/AddMpServer</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddMpServer_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService"><h:AccessInfo>${mpsServer.AccessInfo}</h:AccessInfo><h:InfoFormat>${mpsServer.InfoFormat}</h:InfoFormat><h:Port>${mpsServer.Port}</h:Port><h:AuthMethod>${mpsServer.AuthMethod}</h:AuthMethod><h:Username>${mpsServer.Username}</h:Username><h:Password>${mpsServer.Password}</h:Password><h:CN>${mpsServer.CommonName}</h:CN></h:AddMpServer_INPUT></Body></Envelope>`;
828
+ const response = amtClass.RemoteAccessService.AddMPS(mpsServer);
829
+ expect(response).toEqual(correctResponse);
830
+ });
831
+ it('should return a valid amt_RemoteAccessPolicyRule wsman message', () => {
832
+ const remoteAccessPolicyRule = {
833
+ Trigger: 2,
834
+ TunnelLifeTime: 0,
835
+ ExtendedData: '0300'
836
+ };
837
+ const selector = {
838
+ name: 'myselector',
839
+ value: 'true'
840
+ };
841
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService/AddRemoteAccessPolicyRule</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddRemoteAccessPolicyRule_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RemoteAccessService"><h:Trigger>${remoteAccessPolicyRule.Trigger}</h:Trigger><h:TunnelLifeTime>${remoteAccessPolicyRule.TunnelLifeTime}</h:TunnelLifeTime><h:ExtendedData>${remoteAccessPolicyRule.ExtendedData}</h:ExtendedData><h:MpServer><Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="${selector.name}">${selector.value}</Selector></SelectorSet></ReferenceParameters></h:MpServer></h:AddRemoteAccessPolicyRule_INPUT></Body></Envelope>`;
842
+ const response = amtClass.RemoteAccessService.AddRemoteAccessPolicyRule(remoteAccessPolicyRule, selector);
843
+ expect(response).toEqual(correctResponse);
844
+ });
845
+ });
846
+ describe('SetupAndConfigurationService Tests', () => {
847
+ it('should return a valid amt_SetupAndConfigurationService Get wsman message', () => {
848
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
849
+ const response = amtClass.SetupAndConfigurationService.Get();
850
+ expect(response).toEqual(correctResponse);
851
+ });
852
+ it('should return a valid amt_SetupAndConfigurationService ENUMERATE wsman message', () => {
853
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
854
+ const response = amtClass.SetupAndConfigurationService.Enumerate();
855
+ expect(response).toEqual(correctResponse);
856
+ });
857
+ it('should return a valid amt_SetupAndConfigurationService GetUuid wsman message', () => {
858
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService/GetUuid</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetUuid_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService"></h:GetUuid_INPUT></Body></Envelope>`;
859
+ const response = amtClass.SetupAndConfigurationService.GetUuid();
860
+ expect(response).toEqual(correctResponse);
861
+ });
862
+ it('should create a valid amt_SetupAndConfigurationService Pull wsman message', () => {
863
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
864
+ const response = amtClass.SetupAndConfigurationService.Pull(enumerationContext);
865
+ expect(response).toEqual(correctResponse);
866
+ });
867
+ it('should return a valid amt_SetupAndConfigurationService SetMEBxPassword wsman message', () => {
868
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService/SetMEBxPassword</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:SetMEBxPassword_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService"><h:Password>P@ssw0rd</h:Password></h:SetMEBxPassword_INPUT></Body></Envelope>`;
869
+ const response = amtClass.SetupAndConfigurationService.SetMEBXPassword('P@ssw0rd');
870
+ expect(response).toEqual(correctResponse);
871
+ });
872
+ it('should return a valid amt_SetupAndConfigurationService Unprovision wsman message', () => {
873
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService/Unprovision</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:Unprovision_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService"><h:ProvisioningMode>1</h:ProvisioningMode></h:Unprovision_INPUT></Body></Envelope>`;
874
+ const response = amtClass.SetupAndConfigurationService.Unprovision(1);
875
+ expect(response).toEqual(correctResponse);
876
+ });
877
+ it('should return a valid amt_SetupAndConfigurationService Unprovision wsman message even if provisioningMode is undefined', () => {
878
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService/Unprovision</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:Unprovision_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService"><h:ProvisioningMode>1</h:ProvisioningMode></h:Unprovision_INPUT></Body></Envelope>`;
879
+ const response = amtClass.SetupAndConfigurationService.Unprovision();
880
+ expect(response).toEqual(correctResponse);
881
+ });
882
+ it('should return a valid amt_SetupAndConfigurationService COMMIT_CHANGES wsman message', () => {
883
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService/CommitChanges</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:CommitChanges_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService"></h:CommitChanges_INPUT></Body></Envelope>`;
884
+ const response = amtClass.SetupAndConfigurationService.CommitChanges();
885
+ expect(response).toEqual(correctResponse);
886
+ });
887
+ });
888
+ describe('TimeSynchronizationService Tests', () => {
889
+ it('should return a valid amt_TimeSynchronizationService Get wsman message', () => {
890
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
891
+ const response = amtClass.TimeSynchronizationService.Get();
892
+ expect(response).toEqual(correctResponse);
893
+ });
894
+ it('should return a valid amt_TimeSynchronizationService ENUMERATE wsman message', () => {
895
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
896
+ const response = amtClass.TimeSynchronizationService.Enumerate();
897
+ expect(response).toEqual(correctResponse);
898
+ });
899
+ it('should create a valid amt_TimeSynchronizationService Pull wsman message', () => {
900
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
901
+ const response = amtClass.TimeSynchronizationService.Pull(enumerationContext);
902
+ expect(response).toEqual(correctResponse);
903
+ });
904
+ it('should return a valid amt_TimeSynchronizationService GET_LOW_ACCURACY_TIME_SYNCH wsman message', () => {
905
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService/GetLowAccuracyTimeSynch</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService</w:ResourceURI><a:MessageID>0</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:GetLowAccuracyTimeSynch_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService"></h:GetLowAccuracyTimeSynch_INPUT></Body></Envelope>`;
906
+ const response = amtClass.TimeSynchronizationService.GetLowAccuracyTimeSynch();
907
+ expect(response).toEqual(correctResponse);
908
+ });
909
+ it('should return a valid amt_TimeSynchronizationService SET_HIGH_ACCURACY_TIME_SYNCH wsman message', () => {
910
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService/SetHighAccuracyTimeSynch</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService</w:ResourceURI><a:MessageID>0</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:SetHighAccuracyTimeSynch_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TimeSynchronizationService"><h:Ta0>1644240911</h:Ta0><h:Tm1>1644240943</h:Tm1><h:Tm2>1644240943</h:Tm2></h:SetHighAccuracyTimeSynch_INPUT></Body></Envelope>`;
911
+ const response = amtClass.TimeSynchronizationService.SetHighAccuracyTimeSynch(1644240911, 1644240943, 1644240943);
912
+ expect(response).toEqual(correctResponse);
913
+ });
914
+ });
915
+ describe('TLSCredentialContext Tests', () => {
916
+ const tlsCredentialContext = {
917
+ ElementInContext: {
918
+ Address: 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous',
919
+ ReferenceParameters: {
920
+ ResourceURI: 'http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate',
921
+ SelectorSet: {
922
+ Selector: {
923
+ _: 'Intel(r) AMT Certificate: Handle: 1',
924
+ $: {
925
+ Name: 'InstanceID'
926
+ }
927
+ }
928
+ }
929
+ }
930
+ },
931
+ ElementProvidingContext: {
932
+ Address: 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous',
933
+ ReferenceParameters: {
934
+ ResourceURI: 'http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSProtocolEndpointCollection',
935
+ SelectorSet: {
936
+ Selector: {
937
+ _: 'TLSProtocolEndpoint Instances Collection',
938
+ $: {
939
+ Name: 'ElementName'
940
+ }
941
+ }
942
+ }
943
+ }
944
+ }
945
+ };
946
+ const selector = {
947
+ name: tlsCredentialContext.ElementInContext.ReferenceParameters.SelectorSet.Selector.$.Name,
948
+ value: tlsCredentialContext.ElementInContext.ReferenceParameters.SelectorSet.Selector._
949
+ };
950
+ it('should return a valid TLSCredentialContext Get wsman message', () => {
951
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
952
+ const response = amtClass.TLSCredentialContext.Get();
953
+ expect(response).toEqual(correctResponse);
954
+ });
955
+ it('should return a valid TLSCredentialContext CREATE wsman message', () => {
956
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AMT_TLSCredentialContext xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSCredentialContext"><h:ElementInContext><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Certificate: Handle 1</w:Selector></w:SelectorSet></a:ReferenceParameters></h:ElementInContext><h:ElementProvidingContext><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSProtocolEndpointCollection</w:ResourceURI><w:SelectorSet><w:Selector Name="ElementName">TLSProtocolEndpointInstances Collection</w:Selector></w:SelectorSet></a:ReferenceParameters></h:ElementProvidingContext></h:AMT_TLSCredentialContext></Body></Envelope>`;
957
+ const response = amtClass.TLSCredentialContext.Create('Intel(r) AMT Certificate: Handle 1');
958
+ expect(response).toEqual(correctResponse);
959
+ });
960
+ it('should return a valid TLSCredentialContext ENUMERATE wsman message', () => {
961
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
962
+ const response = amtClass.TLSCredentialContext.Enumerate();
963
+ expect(response).toEqual(correctResponse);
964
+ });
965
+ it('should create a valid TLSCredentialContext Pull wsman message', () => {
966
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
967
+ const response = amtClass.TLSCredentialContext.Pull(enumerationContext);
968
+ expect(response).toEqual(correctResponse);
969
+ });
970
+ it('should return a valid TLSCredentialContext DELETE wsman message', () => {
971
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSCredentialContext</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">Intel(r) AMT Certificate: Handle: 1</w:Selector></w:SelectorSet></Header><Body></Body></Envelope>`;
972
+ const response = amtClass.TLSCredentialContext.Delete(selector);
973
+ expect(response).toEqual(correctResponse);
974
+ });
975
+ });
976
+ describe('TLSSettingData Tests', () => {
977
+ it('should return a valid TLSSettingData Get wsman message', () => {
978
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
979
+ const response = amtClass.TLSSettingData.Get();
980
+ expect(response).toEqual(correctResponse);
981
+ });
982
+ it('should return a valid TLSSettingData PUT wsman message', () => {
983
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="InstanceID">test</w:Selector></w:SelectorSet></Header><Body><h:AMT_TLSSettingData xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSSettingData"><h:AcceptNonSecureConnections>false</h:AcceptNonSecureConnections><h:Enabled>true</h:Enabled><h:MutualAuthentication>false</h:MutualAuthentication><h:NonSecureConnectionsSupported>false</h:NonSecureConnectionsSupported><h:TrustedCN>test</h:TrustedCN><h:ElementName>test</h:ElementName><h:InstanceID>test</h:InstanceID></h:AMT_TLSSettingData></Body></Envelope>`;
984
+ const tlsSettingData = {
985
+ AcceptNonSecureConnections: false,
986
+ Enabled: true,
987
+ MutualAuthentication: false,
988
+ NonSecureConnectionsSupported: false,
989
+ TrustedCN: 'test',
990
+ ElementName: 'test',
991
+ InstanceID: 'test'
992
+ };
993
+ const response = amtClass.TLSSettingData.Put(tlsSettingData);
994
+ expect(response).toEqual(correctResponse);
995
+ });
996
+ it('should return a valid TLSSettingData PULL wsman message', () => {
997
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
998
+ const response = amtClass.TLSSettingData.Pull(enumerationContext);
999
+ expect(response).toEqual(correctResponse);
1000
+ });
1001
+ it('should return a valid TLSSettingData ENUMERATE wsman message', () => {
1002
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_TLSSettingData</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
1003
+ const response = amtClass.TLSSettingData.Enumerate();
1004
+ expect(response).toEqual(correctResponse);
1005
+ });
1006
+ });
1007
+ describe('UserInitiatedConnectionService Tests', () => {
1008
+ it('should return a valid amt_UserInitiatedConnectionService Get wsman message', () => {
1009
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_UserInitiatedConnectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
1010
+ const response = amtClass.UserInitiatedConnectionService.Get();
1011
+ expect(response).toEqual(correctResponse);
1012
+ });
1013
+ it('should return a valid amt_UserInitiatedConnectionService ENUMERATE wsman message', () => {
1014
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_UserInitiatedConnectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
1015
+ const response = amtClass.UserInitiatedConnectionService.Enumerate();
1016
+ expect(response).toEqual(correctResponse);
1017
+ });
1018
+ it('should create a valid amt_UserInitiatedConnectionService Pull wsman message', () => {
1019
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_UserInitiatedConnectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
1020
+ const response = amtClass.UserInitiatedConnectionService.Pull(enumerationContext);
1021
+ expect(response).toEqual(correctResponse);
1022
+ });
1023
+ it('should return a valid amt_UserInitiatedConnectionService AddTrustedRootCertificate wsman message', () => {
1024
+ const requestedState = 32771;
1025
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_UserInitiatedConnectionService/RequestStateChange</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_UserInitiatedConnectionService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:RequestStateChange_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_UserInitiatedConnectionService"><h:RequestedState>${requestedState}</h:RequestedState></h:RequestStateChange_INPUT></Body></Envelope>`;
1026
+ const response = amtClass.UserInitiatedConnectionService.RequestStateChange(requestedState);
1027
+ expect(response).toEqual(correctResponse);
1028
+ });
1029
+ });
1030
+ describe('WiFiPortConfigurationService Tests', () => {
1031
+ let selector;
1032
+ let wifiEndpointSettings;
1033
+ let ieee8021xSettingsInput;
1034
+ let clientCredential, caCredential;
1035
+ beforeEach(() => {
1036
+ selector = {
1037
+ name: 'Name',
1038
+ value: 'WiFi Endpoint 0'
1039
+ };
1040
+ wifiEndpointSettings = {
1041
+ ElementName: 'home',
1042
+ InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings home',
1043
+ AuthenticationMethod: 6,
1044
+ EncryptionMethod: 4,
1045
+ SSID: 'admin',
1046
+ Priority: 1,
1047
+ PSKPassPhrase: 'p\'ass<>&"code'
1048
+ };
1049
+ ieee8021xSettingsInput = {
1050
+ ElementName: 'wifi_8021x_profile',
1051
+ AuthenticationProtocol: 0
1052
+ };
1053
+ clientCredential = 'handle 0';
1054
+ caCredential = 'handle 1';
1055
+ });
1056
+ it('should return a valid amt_WiFiPortConfigurationService ADD_WIFI_SETTINGS wsman message', () => {
1057
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService/AddWiFiSettings</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddWiFiSettings_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService"><h:WiFiEndpoint><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint</w:ResourceURI><w:SelectorSet><w:Selector Name="${selector.name}">${selector.value}</w:Selector></w:SelectorSet></a:ReferenceParameters></h:WiFiEndpoint><h:WiFiEndpointSettingsInput xmlns:q="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings"><q:ElementName>${wifiEndpointSettings.ElementName}</q:ElementName><q:InstanceID>${wifiEndpointSettings.InstanceID}</q:InstanceID><q:AuthenticationMethod>${wifiEndpointSettings.AuthenticationMethod}</q:AuthenticationMethod><q:EncryptionMethod>${wifiEndpointSettings.EncryptionMethod}</q:EncryptionMethod><q:SSID>${wifiEndpointSettings.SSID}</q:SSID><q:Priority>${wifiEndpointSettings.Priority}</q:Priority><q:PSKPassPhrase>p&apos;ass&lt;&gt;&amp;&quot;code</q:PSKPassPhrase></h:WiFiEndpointSettingsInput></h:AddWiFiSettings_INPUT></Body></Envelope>`;
1058
+ const response = amtClass.WiFiPortConfigurationService.AddWiFiSettings(wifiEndpointSettings, selector);
1059
+ expect(response).toEqual(correctResponse);
1060
+ });
1061
+ it('should return a valid amt_WiFiPortConfigurationService ADD_WIFI_SETTINGS with 802.1x wsman message', () => {
1062
+ const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService/AddWiFiSettings</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><h:AddWiFiSettings_INPUT xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService"><h:WiFiEndpoint><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint</w:ResourceURI><w:SelectorSet><w:Selector Name="${selector.name}">${selector.value}</w:Selector></w:SelectorSet></a:ReferenceParameters></h:WiFiEndpoint><h:WiFiEndpointSettingsInput xmlns:q="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings"><q:ElementName>${wifiEndpointSettings.ElementName}</q:ElementName><q:InstanceID>${wifiEndpointSettings.InstanceID}</q:InstanceID><q:AuthenticationMethod>${wifiEndpointSettings.AuthenticationMethod}</q:AuthenticationMethod><q:EncryptionMethod>${wifiEndpointSettings.EncryptionMethod}</q:EncryptionMethod><q:SSID>${wifiEndpointSettings.SSID}</q:SSID><q:Priority>${wifiEndpointSettings.Priority}</q:Priority><q:PSKPassPhrase>p&apos;ass&lt;&gt;&amp;&quot;code</q:PSKPassPhrase></h:WiFiEndpointSettingsInput><h:IEEE8021xSettingsInput xmlns:q="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_IEEE8021xSettings"><q:ElementName>${ieee8021xSettingsInput.ElementName}</q:ElementName><q:AuthenticationProtocol>${ieee8021xSettingsInput.AuthenticationProtocol}</q:AuthenticationProtocol></h:IEEE8021xSettingsInput><h:ClientCredential><a:Address>default</a:Address><a:ReferenceParameters><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">${clientCredential}</w:Selector></w:SelectorSet></a:ReferenceParameters></h:ClientCredential><h:CACredential><a:Address>default</a:Address><a:ReferenceParameters><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">${caCredential}</w:Selector></w:SelectorSet></a:ReferenceParameters></h:CACredential></h:AddWiFiSettings_INPUT></Body></Envelope>`;
1063
+ const response = amtClass.WiFiPortConfigurationService.AddWiFiSettings(wifiEndpointSettings, selector, ieee8021xSettingsInput, clientCredential, caCredential);
1064
+ expect(response).toEqual(correctResponse);
1065
+ });
1066
+ it('should return a valid amt_WiFiPortConfigurationService PUT message ', () => {
1067
+ const putObject = {
1068
+ localProfileSynchronizationEnabled: 3
1069
+ };
1070
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout><w:SelectorSet><w:Selector Name="${selector.name}">${selector.value}</w:Selector></w:SelectorSet></Header><Body><h:AMT_WiFiPortConfigurationService xmlns:h="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService"><h:localProfileSynchronizationEnabled>${putObject.localProfileSynchronizationEnabled}</h:localProfileSynchronizationEnabled></h:AMT_WiFiPortConfigurationService></Body></Envelope>`;
1071
+ const response = amtClass.WiFiPortConfigurationService.Put(putObject, selector);
1072
+ expect(response).toEqual(correctResponse);
1073
+ });
1074
+ it('should return a valid amt_WiFiPortConfigurationService GET message ', () => {
1075
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body></Body></Envelope>`;
1076
+ const response = amtClass.WiFiPortConfigurationService.Get();
1077
+ expect(response).toEqual(correctResponse);
1078
+ });
1079
+ it('should return a valid amt_WiFiPortConfigurationService ENUMERATE wsman message', () => {
1080
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>`;
1081
+ const response = amtClass.WiFiPortConfigurationService.Enumerate();
1082
+ expect(response).toEqual(correctResponse);
1083
+ });
1084
+ it('should create a valid amt_WiFiPortConfigurationService Pull wsman message', () => {
1085
+ const correctResponse = `${xmlHeader}${envelope}http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_WiFiPortConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>${enumerationContext}</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>`;
1086
+ const response = amtClass.WiFiPortConfigurationService.Pull(enumerationContext);
1087
+ expect(response).toEqual(correctResponse);
1088
+ });
1089
+ });
1090
+ });
1091
+ //# sourceMappingURL=messages.test.js.map