View Javadoc
1   /*
2    * Copyright 2021-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.driver.linux;
6   
7   import static org.hamcrest.MatcherAssert.assertThat;
8   import static org.hamcrest.Matchers.matchesRegex;
9   import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
10  
11  import org.junit.jupiter.api.Test;
12  
13  import oshi.TestConstants;
14  
15  class DmidecodeTest {
16  
17      @Test
18      void testQueries() {
19          assertDoesNotThrow(Dmidecode::querySerialNumber);
20          assertDoesNotThrow(Dmidecode::queryBiosNameRev);
21  
22          final String uuid = Dmidecode.queryUUID();
23          if (uuid != null) {
24              assertThat("Test Lshal queryUUID format", uuid, matchesRegex(TestConstants.UUID_REGEX));
25          }
26      }
27  }