mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-21 05:53:27 +00:00
Updated some code and took out things that didin't need to be in the official build for unit tests
This commit is contained in:
parent
5589096443
commit
653bfddc6d
@ -84,7 +84,7 @@ public class ComponentClass {
|
||||
*/
|
||||
public ComponentClass(final Path componentClassPath, final String componentIdentifier) {
|
||||
this(componentClassPath, getComponentIntValue(componentIdentifier));
|
||||
if (componentIdentifier.contains("#")) {
|
||||
if (componentIdentifier != null && componentIdentifier.contains("#")) {
|
||||
this.classValueString = componentIdentifier.replaceAll("#", "");
|
||||
} else {
|
||||
this.classValueString = componentIdentifier;
|
||||
|
@ -1121,7 +1121,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
+ "Platform serial did not match\n"
|
||||
+ "There are unmatched components:\n"
|
||||
+ "Manufacturer=Intel, Model=platform2018,"
|
||||
+ " Serial=BQKP52840678, Revision=1.0\n";
|
||||
+ " Serial=BQKP52840678, Revision=1.0;\n";
|
||||
|
||||
AppraisalStatus result =
|
||||
supplyChainCredentialValidator.validatePlatformCredentialAttributes(
|
||||
@ -1767,7 +1767,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n"
|
||||
+ "There are unmatched components:\n"
|
||||
+ "Manufacturer=, Model=Core i7, Serial=Not Specified,"
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\n");
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz;\n");
|
||||
|
||||
platformCredential = setupMatchingPlatformCredential(deviceInfoReport);
|
||||
result = SupplyChainCredentialValidator
|
||||
@ -1823,7 +1823,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
deviceInfoReport);
|
||||
Assert.assertEquals(result.getAppStatus(), AppraisalStatus.Status.FAIL);
|
||||
Assert.assertEquals(result.getMessage(), "There are unmatched components:\n"
|
||||
+ "Manufacturer=ACME, Model=TNT, Serial=2, Revision=1.1\n");
|
||||
+ "Manufacturer=ACME, Model=TNT, Serial=2, Revision=1.1;\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1887,7 +1887,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n"
|
||||
+ "There are unmatched components:\n"
|
||||
+ "Manufacturer=, Model=Core i7, Serial=Not Specified,"
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\n");
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz;\n");
|
||||
|
||||
platformCredential = setupMatchingPlatformCredential(deviceInfoReport);
|
||||
result = SupplyChainCredentialValidator
|
||||
@ -2222,7 +2222,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
"There are unmatched components:\n"
|
||||
+ "Manufacturer=Intel Corporation, Model=82580 "
|
||||
+ "Gigabit Network Connection-faulty, "
|
||||
+ "Serial=90:e2:ba:31:83:10, Revision=\n");
|
||||
+ "Serial=90:e2:ba:31:83:10, Revision=;\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user