use of com.intel.mtwilson.datatypes.PCRWhiteList in project OpenAttestation by OpenAttestation.
the class MleBOTest method testAddPCRWhiteList.
@Test
public void testAddPCRWhiteList() {
PCRWhiteList biosPcrData = new PCRWhiteList("0", "31B97D97B4679917EC3C1D943635693FFBAB4143", "DELL", "A08", "", "", "DELL");
PCRWhiteList vmmPcrData = new PCRWhiteList("18", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "XEN", "4.3", "Fedora", "20", "");
doReturn(new TblMle(MLE_ID1, "DELL", "A08", "PCR", "BIOS", "0")).when(tblMleJpaController).findBiosMle(biosPcrData.getMleName(), biosPcrData.getMleVersion(), biosPcrData.getOemName());
doReturn(new TblMle(MLE_ID2, "XEN", "4.3", "PCR", "VMM", "18")).when(tblMleJpaController).findVmmMle(vmmPcrData.getMleName(), vmmPcrData.getMleVersion(), vmmPcrData.getOsName(), vmmPcrData.getOsVersion());
doReturn(null).when(tblPcrManifestJpaController).findByMleIdName(MLE_ID1, biosPcrData.getPcrName());
doReturn(null).when(tblPcrManifestJpaController).findByMleIdName(MLE_ID2, vmmPcrData.getPcrName());
String biosResult = mleBO.addPCRWhiteList(biosPcrData);
assertEquals("true", biosResult);
String vmmResult = mleBO.addPCRWhiteList(vmmPcrData);
assertEquals("true", vmmResult);
}
use of com.intel.mtwilson.datatypes.PCRWhiteList in project OpenAttestation by OpenAttestation.
the class MleBOTest method testUpdatePCRWhiteList.
@Test
public void testUpdatePCRWhiteList() {
PCRWhiteList biosPcrData = new PCRWhiteList("0", "31B97D97B4679917EC3C1D943635693FFBAB4143", "DELL", "A08", "", "", "DELL");
PCRWhiteList vmmPcrData = new PCRWhiteList("18", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "XEN", "4.3", "Fedora", "20", "");
doReturn(new TblMle(MLE_ID1, "DELL", "A08", "PCR", "BIOS", "0")).when(tblMleJpaController).findBiosMle(biosPcrData.getMleName(), biosPcrData.getMleVersion(), biosPcrData.getOemName());
doReturn(new TblMle(MLE_ID2, "XEN", "4.3", "PCR", "VMM", "18")).when(tblMleJpaController).findVmmMle(vmmPcrData.getMleName(), vmmPcrData.getMleVersion(), vmmPcrData.getOsName(), vmmPcrData.getOsVersion());
doReturn(new TblPcrManifest(PcrManifest_ID1, biosPcrData.getPcrName(), biosPcrData.getPcrDigest())).when(tblPcrManifestJpaController).findByMleIdName(MLE_ID1, biosPcrData.getPcrName());
doReturn(new TblPcrManifest(PcrManifest_ID2, vmmPcrData.getPcrName(), vmmPcrData.getPcrDigest())).when(tblPcrManifestJpaController).findByMleIdName(MLE_ID2, vmmPcrData.getPcrName());
String biosResult = mleBO.updatePCRWhiteList(biosPcrData);
assertEquals("true", biosResult);
String vmmResult = mleBO.updatePCRWhiteList(vmmPcrData);
assertEquals("true", vmmResult);
}
Aggregations