mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-19 04:58:00 +00:00
Merge pull request #388 from nsacyber/ignore-tpmbaselinegeneratortest-csvgeneratortest
Ignore tests from TPMBaselineGeneratorTest and ima.CSVGeneratorTest.
This commit is contained in:
commit
3132a590e1
@ -21,9 +21,6 @@ import org.apache.commons.codec.DecoderException;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.AfterTest;
|
||||
import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Test;
|
||||
import hirs.data.persist.ImaBlacklistRecordTest;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
@ -49,7 +46,7 @@ public final class CSVGeneratorTest {
|
||||
* Builds objects for test.
|
||||
* @throws DecoderException when the Digest fails.
|
||||
*/
|
||||
@BeforeTest
|
||||
//@BeforeTest
|
||||
void setUp() throws DecoderException {
|
||||
imaRecord1 = new IMABaselineRecord("/path/1",
|
||||
new Digest(DigestAlgorithm.SHA1, DatatypeConverter.parseHexBinary(HASH1)));
|
||||
@ -67,7 +64,7 @@ public final class CSVGeneratorTest {
|
||||
/**
|
||||
* Cleans up after test.
|
||||
*/
|
||||
@AfterTest
|
||||
//@AfterTest
|
||||
void tearDown() {
|
||||
imaBaseline = null;
|
||||
imaRecord1 = null;
|
||||
@ -83,7 +80,7 @@ public final class CSVGeneratorTest {
|
||||
/**
|
||||
* Test encodeImaBaseline.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public void testEncodeImaBaseline() {
|
||||
System.out.println(CSVGenerator.imaRecordsToCsv(imaBaseline));
|
||||
Assert.assertEquals(CSV, CSVGenerator.imaRecordsToCsv(imaBaseline));
|
||||
@ -95,7 +92,7 @@ public final class CSVGeneratorTest {
|
||||
*
|
||||
* @throws IOException if there is a problem serializing the baseline
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public void testImaBlacklistBaselineWithDescriptionsToCsv() throws IOException {
|
||||
Assert.assertEquals(
|
||||
CSVGenerator.blacklistToCsv(getTestImaBlacklistBaselineWithDescriptions()),
|
||||
@ -109,7 +106,7 @@ public final class CSVGeneratorTest {
|
||||
*
|
||||
* @throws IOException if there is a problem serializing the baseline
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public void testImaBlacklistBaselineWithoutDescriptionsToCsv() throws IOException {
|
||||
Assert.assertEquals(
|
||||
CSVGenerator.blacklistToCsv(getTestImaBlacklistBaselineWithoutDescriptions()),
|
||||
@ -125,7 +122,7 @@ public final class CSVGeneratorTest {
|
||||
* @throws ParseException if there is a problem parsing the csv.
|
||||
* @throws TPMBaselineGeneratorException if there is a problem generating the baseline.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public void testTpmRecordsToCsv()
|
||||
throws IOException, ParseException, TPMBaselineGeneratorException {
|
||||
final String biosVersion = "abc";
|
||||
|
@ -14,7 +14,6 @@ import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import hirs.data.persist.DeviceInfoReport;
|
||||
import hirs.data.persist.Digest;
|
||||
@ -56,7 +55,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if error encountered when retrieving entries from
|
||||
* input stream
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromCSVFile() throws IOException,
|
||||
ParseException, TPMBaselineGeneratorException {
|
||||
InputStream in;
|
||||
@ -88,7 +87,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if error encountered when retrieving measurement entries from
|
||||
* input stream
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromCSVFileNullBaselineName()
|
||||
throws IOException, ParseException, TPMBaselineGeneratorException {
|
||||
Exception expectedEx = null;
|
||||
@ -116,7 +115,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if error encountered when retrieving measurement entries from
|
||||
* input stream
|
||||
*/
|
||||
@Test(expectedExceptions = NullPointerException.class)
|
||||
//@Test(expectedExceptions = NullPointerException.class)
|
||||
public final void generateBaselineFromCSVFileNullInputStream()
|
||||
throws IOException, ParseException, TPMBaselineGeneratorException {
|
||||
new TPMBaselineGenerator().generateWhiteListBaselineFromCSVFile(
|
||||
@ -132,7 +131,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* @throws ParseException
|
||||
* if error encountered parsing data
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromCSVFileContainsNoRecords()
|
||||
throws IOException, ParseException {
|
||||
Exception expectedEx = null;
|
||||
@ -163,7 +162,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if error encountered when retrieving measurement entries from
|
||||
* input stream
|
||||
*/
|
||||
@Test(expectedExceptions = TPMBaselineGeneratorException.class)
|
||||
//@Test(expectedExceptions = TPMBaselineGeneratorException.class)
|
||||
public final void generateBaselineFromCSVFileContainsAdditionalFields()
|
||||
throws IOException, ParseException, TPMBaselineGeneratorException {
|
||||
String testBaselinePath = "/tpm/TPMTestAdditionalFields.csv";
|
||||
@ -189,7 +188,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* @throws ParseException
|
||||
* if error encountered parsing data
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromCSVFileContainsInvalidRecords()
|
||||
throws IOException, ParseException {
|
||||
Exception expectedEx = null;
|
||||
@ -219,7 +218,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if error encountered when retrieving entries from
|
||||
* input stream
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromCSVFileContainsDeviceInfoRecords()
|
||||
throws IOException, ParseException, TPMBaselineGeneratorException {
|
||||
final String baselinePath = "/tpm/TPMTestBaselineWithDeviceInfo.csv";
|
||||
@ -280,7 +279,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if error encountered when retrieving entries from
|
||||
* input stream
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromCSVFileContainsInvalidDeviceInfo()
|
||||
throws IOException, ParseException, TPMBaselineGeneratorException {
|
||||
final String baselinePath = "/tpm/TPMTestBaselineWithInvalidDeviceInfo.csv";
|
||||
@ -308,7 +307,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* @throws Exception
|
||||
* if any unexpected errors occur
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromIntegrityReport() throws Exception {
|
||||
final IntegrityReport report = getIntegrityReport(
|
||||
DEFAULT_INTEGRITY_REPORT);
|
||||
@ -359,7 +358,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* @throws Exception
|
||||
* if any unexpected errors occur
|
||||
*/
|
||||
@Test(expectedExceptions = NullPointerException.class)
|
||||
//@Test(expectedExceptions = NullPointerException.class)
|
||||
public final void generateBaselineFromIntegrityReportNullBaselineName()
|
||||
throws Exception {
|
||||
final IntegrityReport report = getIntegrityReport(
|
||||
@ -376,7 +375,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* if number of PCRs measurements in report is zero, or more
|
||||
* than maximum, or no PCR measurements in the report.
|
||||
*/
|
||||
@Test(expectedExceptions = NullPointerException.class)
|
||||
//@Test(expectedExceptions = NullPointerException.class)
|
||||
public final void generateBaselineFromInetgrityReportNullIntegrityReport()
|
||||
throws TPMBaselineGeneratorException {
|
||||
final TPMBaselineGenerator generator = new TPMBaselineGenerator();
|
||||
@ -396,7 +395,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* @throws Exception
|
||||
* if any unexpected error occur
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineFromIntegrityReportNoPCRs()
|
||||
throws TPMBaselineGeneratorException, Exception {
|
||||
final IntegrityReport report = getIntegrityReport(
|
||||
@ -411,7 +410,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* expected name, the appropriate device info, and the selected kernel PCR values.
|
||||
* @throws Exception If there is a problem.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineOnKernelUpdate() throws Exception {
|
||||
final String name = "Monday";
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
@ -442,7 +441,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* expected name, the appropriate device info, and no measurement records.
|
||||
* @throws Exception If there is a problem.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineOnKernelUpdateKernelPcrIs0() throws Exception {
|
||||
final String name = "Monday";
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
@ -467,7 +466,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* the name or report parameters are null.
|
||||
* @throws Exception If there is an unexpected problem.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineOnKernelUpdateNullParams() throws Exception {
|
||||
final String name = "Monday";
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
@ -494,7 +493,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* and leaves the default device info when there is no device info report.
|
||||
* @throws Exception If there is a problem.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateBaselineOnKernelUpdateNoReport() throws Exception {
|
||||
final String name = "Monday";
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
@ -518,7 +517,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* given integrity report.
|
||||
* @throws Exception if a problem occurs.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateNameForKernelUpdateBaseline() throws Exception {
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
final TPMBaselineGenerator generator = new TPMBaselineGenerator();
|
||||
@ -531,7 +530,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* given an integrity report with no device info report.
|
||||
* @throws Exception if a problem occurs.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateNameForKernelUpdateBaselineNoDeviceInfoReport() throws Exception {
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
// remove the device info report
|
||||
@ -551,7 +550,7 @@ public class TPMBaselineGeneratorTest {
|
||||
* integrity report with no relevant OS info.
|
||||
* @throws Exception if a problem occurs.
|
||||
*/
|
||||
@Test
|
||||
//@Test
|
||||
public final void generateNameForKernelUpdateBaselineNoRelevantDeviceInfo() throws Exception {
|
||||
final IntegrityReport report = getIntegrityReport(DEFAULT_INTEGRITY_REPORT);
|
||||
// remove the existing deviceInfoReport
|
||||
|
Loading…
Reference in New Issue
Block a user