@Test public void entIsCompliantIfSocketsNotSetOnEntPool() { Consumer c = mock(Consumer.class); when(c.hasFact("cpu.cpu_socket(s)")).thenReturn(true); when(c.getFact("cpu.cpu_socket(s)")).thenReturn("2"); Entitlement ent = mockEntitlement(c, PRODUCT_1); assertTrue(compliance.isEntitlementCompliant(c, ent)); }
@Test public void entIsNotCompliantWhenSocketsAreNotCovered() { Consumer c = mock(Consumer.class); when(c.hasFact("cpu.cpu_socket(s)")).thenReturn(true); when(c.getFact("cpu.cpu_socket(s)")).thenReturn("8"); Entitlement ent = mockEntitlement(c, PRODUCT_1); ent.getPool().setProductAttribute("sockets", "4", PRODUCT_1); assertFalse(compliance.isEntitlementCompliant(c, ent)); }
@Test public void stackIsCompliant() { Consumer c = mock(Consumer.class); when(c.hasFact("cpu.cpu_socket(s)")).thenReturn(true); when(c.getFact("cpu.cpu_socket(s)")).thenReturn("2"); List<Entitlement> ents = new LinkedList<Entitlement>(); ents.add(mockStackedEntitlement(c, STACK_ID_1, "Awesome Product", PRODUCT_1)); assertTrue(compliance.isStackCompliant(c, STACK_ID_1, ents)); }