summaryrefslogtreecommitdiff
path: root/src/test/burn
diff options
context:
space:
mode:
authorchris_bednarski <Chris.Bednarski@minfos.com.au>2023-08-20 19:49:21 +1000
committerBob Arnson <github@bobs.org>2023-08-23 23:11:39 -0400
commit537e79d3c8b99e1576db48b19c8071c0922342f2 (patch)
treea3a21f66c55edf08def75bfa2c05c297886ad18b /src/test/burn
parentfebb9c943d6c6c0db3a660de6f96b7d9f5941b1a (diff)
downloadwix-537e79d3c8b99e1576db48b19c8071c0922342f2.tar.gz
wix-537e79d3c8b99e1576db48b19c8071c0922342f2.tar.bz2
wix-537e79d3c8b99e1576db48b19c8071c0922342f2.zip
use WcaGetRecordFormattedString to get firewall rule description
Diffstat (limited to 'src/test/burn')
-rw-r--r--src/test/burn/WixTestTools/Firewall/RuleDetails.cs4
-rw-r--r--src/test/burn/WixTestTools/Firewall/UniqueCheck.cs9
-rw-r--r--src/test/burn/WixTestTools/Firewall/Verifier.cs2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/test/burn/WixTestTools/Firewall/RuleDetails.cs b/src/test/burn/WixTestTools/Firewall/RuleDetails.cs
index 38a80bb8..d1e53de4 100644
--- a/src/test/burn/WixTestTools/Firewall/RuleDetails.cs
+++ b/src/test/burn/WixTestTools/Firewall/RuleDetails.cs
@@ -164,7 +164,7 @@ namespace WixTestTools.Firewall
164 public bool? Enabled { get; set; } 164 public bool? Enabled { get; set; }
165 165
166 /// <summary> 166 /// <summary>
167 /// This property is optional. It specifies the group to which an individual rule belongs and groups multiple rules into a single line in the Windows Firewall control panel<br/> 167 /// This property is optional. It specifies the group to which an individual rule belongs and groups multiple rules into a single line in the Windows Firewall control panel.<br/>
168 /// This allows the users to enable or disable multiple rules with a single click.<br/> 168 /// This allows the users to enable or disable multiple rules with a single click.<br/>
169 /// The Grouping property can also be specified using indirect strings.<br/> 169 /// The Grouping property can also be specified using indirect strings.<br/>
170 /// Example: "Simple Group Name"<br/> 170 /// Example: "Simple Group Name"<br/>
@@ -193,7 +193,7 @@ namespace WixTestTools.Firewall
193 193
194 /// <summary> 194 /// <summary>
195 /// This property is optional. The NET_FW_ACTION enumerated type specifies the action for this rule.<br/> 195 /// This property is optional. The NET_FW_ACTION enumerated type specifies the action for this rule.<br/>
196 /// NET_FW_ACTION_ALLOW is the default value. Profiles can be combined from the following values:<br/> 196 /// NET_FW_ACTION_ALLOW is the default value. The Action must be specified from the following list of values:<br/>
197 /// <b>o</b> NET_FW_ACTION_BLOCK = 0x0<br/> 197 /// <b>o</b> NET_FW_ACTION_BLOCK = 0x0<br/>
198 /// <b>o</b> NET_FW_ACTION_ALLOW = 0x1<br/> 198 /// <b>o</b> NET_FW_ACTION_ALLOW = 0x1<br/>
199 /// </summary> 199 /// </summary>
diff --git a/src/test/burn/WixTestTools/Firewall/UniqueCheck.cs b/src/test/burn/WixTestTools/Firewall/UniqueCheck.cs
index 83a1e57a..598350f9 100644
--- a/src/test/burn/WixTestTools/Firewall/UniqueCheck.cs
+++ b/src/test/burn/WixTestTools/Firewall/UniqueCheck.cs
@@ -6,7 +6,7 @@ namespace WixTestTools.Firewall
6 6
7 /// <summary> 7 /// <summary>
8 /// A lot of firewall rules don't follow the Microsoft recommendation of using unique names.<br/> 8 /// A lot of firewall rules don't follow the Microsoft recommendation of using unique names.<br/>
9 /// This class helps to disambiguate the rules based on Name, Direction, Profile, Protocol, ApplicationName and the LocalUserOwner. 9 /// This class helps to disambiguate the rules based on Name, Direction, Profile, Protocol, ApplicationName, LocalUserOwner and RemoteAddresses.
10 /// </summary> 10 /// </summary>
11 public class UniqueCheck 11 public class UniqueCheck
12 { 12 {
@@ -22,6 +22,7 @@ namespace WixTestTools.Firewall
22 this.Protocol = details.Protocol; 22 this.Protocol = details.Protocol;
23 this.ApplicationName = details.ApplicationName; 23 this.ApplicationName = details.ApplicationName;
24 this.LocalUserOwner = details.LocalUserOwner; 24 this.LocalUserOwner = details.LocalUserOwner;
25 this.RemoteAddresses = details.RemoteAddresses;
25 } 26 }
26 27
27 28
@@ -37,6 +38,7 @@ namespace WixTestTools.Firewall
37 38
38 public string LocalUserOwner { get; set; } 39 public string LocalUserOwner { get; set; }
39 40
41 public string RemoteAddresses { get; set; }
40 42
41 public bool FirewallRuleIsUnique(INetFwRule3 rule) 43 public bool FirewallRuleIsUnique(INetFwRule3 rule)
42 { 44 {
@@ -70,6 +72,11 @@ namespace WixTestTools.Firewall
70 return false; 72 return false;
71 } 73 }
72 74
75 if (this.RemoteAddresses != null && rule.RemoteAddresses != this.RemoteAddresses)
76 {
77 return false;
78 }
79
73 return true; 80 return true;
74 } 81 }
75 } 82 }
diff --git a/src/test/burn/WixTestTools/Firewall/Verifier.cs b/src/test/burn/WixTestTools/Firewall/Verifier.cs
index d3f32c5c..c1bf3219 100644
--- a/src/test/burn/WixTestTools/Firewall/Verifier.cs
+++ b/src/test/burn/WixTestTools/Firewall/Verifier.cs
@@ -281,7 +281,9 @@ namespace WixTestTools.Firewall
281 Assert.True(expected.ServiceName == actual.ServiceName, FormatErrorMessage(name, "ServiceNames", expected.ServiceName, actual.ServiceName, unique)); 281 Assert.True(expected.ServiceName == actual.ServiceName, FormatErrorMessage(name, "ServiceNames", expected.ServiceName, actual.ServiceName, unique));
282 Assert.True(expected.Protocol == actual.Protocol, FormatErrorMessage(name, "Protocols", expected.Protocol, actual.Protocol, unique)); 282 Assert.True(expected.Protocol == actual.Protocol, FormatErrorMessage(name, "Protocols", expected.Protocol, actual.Protocol, unique));
283 Assert.True(expected.LocalPorts == actual.LocalPorts, FormatErrorMessage(name, "LocalPorts", expected.LocalPorts, actual.LocalPorts, unique)); 283 Assert.True(expected.LocalPorts == actual.LocalPorts, FormatErrorMessage(name, "LocalPorts", expected.LocalPorts, actual.LocalPorts, unique));
284 Assert.True(expected.LocalAddresses == actual.LocalAddresses, FormatErrorMessage(name, "LocalAddresses", expected.LocalAddresses, actual.LocalAddresses, unique));
284 Assert.True(expected.RemotePorts == actual.RemotePorts, FormatErrorMessage(name, "RemotePorts", expected.RemotePorts, actual.RemotePorts, unique)); 285 Assert.True(expected.RemotePorts == actual.RemotePorts, FormatErrorMessage(name, "RemotePorts", expected.RemotePorts, actual.RemotePorts, unique));
286 Assert.True(expected.RemoteAddresses == actual.RemoteAddresses, FormatErrorMessage(name, "RemoteAddresses", expected.RemoteAddresses, actual.RemoteAddresses, unique));
285 Assert.True(expected.IcmpTypesAndCodes == actual.IcmpTypesAndCodes, FormatErrorMessage(name, "IcmpTypesAndCodes", expected.IcmpTypesAndCodes, actual.Description, unique)); 287 Assert.True(expected.IcmpTypesAndCodes == actual.IcmpTypesAndCodes, FormatErrorMessage(name, "IcmpTypesAndCodes", expected.IcmpTypesAndCodes, actual.Description, unique));
286 Assert.True(expected.Direction == actual.Direction, FormatErrorMessage(name, "Directions", expected.Direction, actual.Direction, unique)); 288 Assert.True(expected.Direction == actual.Direction, FormatErrorMessage(name, "Directions", expected.Direction, actual.Direction, unique));
287 Assert.Equal<object>(expected.Interfaces, actual.Interfaces); 289 Assert.Equal<object>(expected.Interfaces, actual.Interfaces);