use of com.intel.mtwilson.datatypes.HostTrustStatus in project OpenAttestation by OpenAttestation.
the class HostTrustBOTest method testGetTrustStatus.
@Test
public void testGetTrustStatus() throws Exception {
TblHosts tblHosts = mockGetHostByIpAddress();
doReturn(tblHosts).when(hostTrustBO).getHostByIpAddress(SERVER_NAME);
//get pcrMap
HashMap<String, IManifest> pcrManifestMap = new HashMap<String, IManifest>();
pcrManifestMap.put("0", new PcrManifest(0, "31B97D97B4679917EC3C1D943635693FFBAB4143"));
pcrManifestMap.put("18", new PcrManifest(18, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"));
doReturn(pcrManifestMap).when(manifestStrategy).getManifest(tblHosts);
//get gkv for given host
HashMap<String, IManifest> gkvBiosPcrManifestMap = new HashMap<String, IManifest>();
HashMap<String, IManifest> gkvVmmPcrManifestMap = new HashMap<String, IManifest>();
gkvBiosPcrManifestMap.put("0", new PcrManifest(0, "31B97D97B4679917EC3C1D943635693FFBAB4143"));
gkvVmmPcrManifestMap.put("18", new PcrManifest(18, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"));
doReturn(gkvBiosPcrManifestMap).when(gkvStrategy).getBiosGoodKnownManifest(anyString(), anyString(), anyString());
doReturn(gkvVmmPcrManifestMap).when(gkvStrategy).getVmmGoodKnownManifest(anyString(), anyString(), anyString(), anyString(), any(Integer.class));
doNothing().when(taLogJpaController).create(any(TblTaLog.class));
HostTrustStatus trustStatus = hostTrustBO.getTrustStatus(new Hostname(SERVER_NAME));
assertNotNull(trustStatus);
assertTrue(trustStatus.bios);
assertTrue(trustStatus.vmm);
}
use of com.intel.mtwilson.datatypes.HostTrustStatus in project OpenAttestation by OpenAttestation.
the class HostBOTest method mockHost.
public TxtHost mockHost() {
TxtHostRecord hostRecord = new TxtHostRecord();
HostTrustStatus trustStatus = new HostTrustStatus();
hostRecord.HostName = SERVER_NAME;
hostRecord.IPAddress = SERVER_NAME;
hostRecord.BIOS_Name = "DELL";
hostRecord.BIOS_Version = "A08";
hostRecord.BIOS_Oem = "DELL";
hostRecord.VMM_Name = "XENESX";
hostRecord.VMM_Version = "4.3";
hostRecord.VMM_OSName = "Fedora";
hostRecord.VMM_OSVersion = "20";
hostRecord.AddOn_Connection_String = "intel:https://" + SERVER_NAME + ":9999";
hostRecord.Port = Integer.valueOf(9999);
trustStatus.bios = true;
trustStatus.vmm = true;
TxtHost host = new TxtHost(hostRecord, trustStatus);
return host;
}
Aggregations