Skip to content

Commit

Permalink
Prevent booking frames on hosts with full MCP
Browse files Browse the repository at this point in the history
- Fix tests: testHandleHostReportWithFullMCPDirectories() and testHandleHostReportWithHardwareStateRepairNotRelatedToFullMCPdirectories()
  • Loading branch information
ramonfigueiredo committed Jul 18, 2023
1 parent dcf27a5 commit 1aa4ab6
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public class HostReportHandlerTests extends TransactionalTest {

private static final String HOSTNAME = "beta";
private static final String NEW_HOSTNAME = "gamma";
private String hostname;
private String hostname2;
private static final String SUBJECT_COMMENT_FULL_MCP_DIR = "Host set to REPAIR for not having enough storage " +
"space on /mcp";
private static final String CUEBOT_COMMENT_USER = "cuebot";
Expand All @@ -97,8 +95,6 @@ public void setTestMode() {

@Before
public void createHost() {
hostname = UUID.randomUUID().toString().substring(0, 8);
hostname2 = UUID.randomUUID().toString().substring(0, 8);
hostManager.createHost(getRenderHost(),
adminManager.findAllocationDetail("spi","general"));
}
Expand Down Expand Up @@ -289,7 +285,7 @@ public void testHandleHostReportWithFullMCPDirectories() {
* */
// Create HostReport
HostReport report1 = HostReport.newBuilder()
.setHost(getRenderHost(hostname, HardwareState.UP, 1024L))
.setHost(getRenderHost(HOSTNAME, HardwareState.UP, 1024L))
.setCoreInfo(cores)
.build();
// Call handleHostReport() => Create the comment with subject=SUBJECT_COMMENT_FULL_MCP_DIR and change the host's
Expand Down Expand Up @@ -331,7 +327,7 @@ public void testHandleHostReportWithFullMCPDirectories() {
* */
// Set the host freeMcp to the minimum size required = 1GB (1048576 KB)
HostReport report2 = HostReport.newBuilder()
.setHost(getRenderHost(hostname, HardwareState.UP, 1048576L))
.setHost(getRenderHost(HOSTNAME, HardwareState.UP, 1048576L))
.setCoreInfo(cores)
.build();
// Call handleHostReport() => Delete the comment with subject=SUBJECT_COMMENT_FULL_MCP_DIR and change the host's
Expand Down Expand Up @@ -369,7 +365,7 @@ public void testHandleHostReportWithHardwareStateRepairNotRelatedToFullMCPdirect
* */
// Create HostReport
HostReport report = HostReport.newBuilder()
.setHost(getRenderHost(hostname, HardwareState.UP, 1048576L))
.setHost(getRenderHost(HOSTNAME, HardwareState.UP, 1048576L))
.setCoreInfo(cores)
.build();
// Get host
Expand Down

0 comments on commit 1aa4ab6

Please sign in to comment.