mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
maven: Fix build on osx (#6056)
kvm: don't read /proc/meminfo on non-Linux environments as part of constructor Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
This commit is contained in:
parent
cb872ab6bd
commit
2f6fc56e74
@ -48,7 +48,9 @@ public class MemStat {
|
||||
public MemStat(long reservedMemory, long overCommitMemory) {
|
||||
this.reservedMemory = reservedMemory;
|
||||
this.overCommitMemory = overCommitMemory;
|
||||
this.refresh();
|
||||
if (System.getProperty("os.name").equals("Linux")) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
|
||||
@ -5557,6 +5557,9 @@ public class LibvirtComputingResourceTest {
|
||||
|
||||
@Test
|
||||
public void testMemoryFreeInKBsDomainReturningOfSomeMemoryStatistics() throws LibvirtException {
|
||||
if (!System.getProperty("os.name").equals("Linux")) {
|
||||
return;
|
||||
}
|
||||
LibvirtComputingResource libvirtComputingResource = new LibvirtComputingResource();
|
||||
|
||||
MemoryStatistic[] mem = createMemoryStatisticFreeMemory100();
|
||||
|
||||
@ -46,6 +46,9 @@ public class MemStatTest {
|
||||
@Test
|
||||
public void getMemInfoParseTest() {
|
||||
MemStat memStat = new MemStat();
|
||||
if (!System.getProperty("os.name").equals("Linux")) {
|
||||
return;
|
||||
}
|
||||
|
||||
Assert.assertEquals(memStat.getTotal(), 5970161664L);
|
||||
Assert.assertEquals(memStat.getAvailable(), 3164520448L);
|
||||
@ -56,6 +59,9 @@ public class MemStatTest {
|
||||
@Test
|
||||
public void reservedMemoryTest() {
|
||||
MemStat memStat = new MemStat(1024, 2048);
|
||||
if (!System.getProperty("os.name").equals("Linux")) {
|
||||
return;
|
||||
}
|
||||
Assert.assertEquals(memStat.getTotal(), 5970162688L);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user