gcontini
2020-10-11 34c994011ba790167c2ffa8a9f7da78e38236147
add tests/docs for Ubuntu 20.04
5个文件已修改
1个文件已删除
25 ■■■■■ 已修改文件
.github/FUNDING.YML 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.github/workflows/cpp.yml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/development/Build-the-library.md 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/development/Dependencies.md 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/library/os/linux/os_linux.cpp 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/library/os_linux_test.cpp 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.github/FUNDING.YML
File was deleted
.github/workflows/cpp.yml
@@ -9,6 +9,9 @@
    steps:
    - uses: actions/checkout@v1
    - name: Setup Boost (Windows / Linux latest)
      shell: bash
      run: echo "BOOST_ROOT=$BOOST_ROOT_1_72_0" >> $GITHUB_ENV
    - name: Compile & Test
      run: |
        mkdir -p build
doc/development/Build-the-library.md
@@ -1,10 +1,11 @@
# Build - Linux
## Install prerequisites
Below the prerequisites for compiling open-license-manager. For developing it we use Eclipse. Recent CDT works smoothly with CMake. Remember to install the Ninja package as build system and Cmake Gui for a good eclipse integration.
Below the prerequisites for compiling `open-license-manager`. For developing it we use Eclipse.
Recent CDT works smoothly with CMake. Remember to install the Ninja package as build system and Cmake Gui for a good eclipse integration.
 
### Ubuntu
Supported Ubuntu distributions are 18.04 (Bionic Beaver) and 16.04 (Xenial) though it should be possible to build on any recent Ubuntu version.
Supported Ubuntu distributions are 20.04 (Focal Fossa), 18.04 (Bionic Beaver) and 16.04 (Xenial). It should be possible to build on any recent Ubuntu (debian like) version.
Install prerequisites:
doc/development/Dependencies.md
@@ -11,6 +11,7 @@
| Operating System               | Openssl    | Zlib                        | Boost<sup>2</sup>   |
|--------------------------------|:----------:|:---------------------------:|:-------------------:| 
| Ubuntu 20.04     | :heavy_check_mark: v1.1.1f| :question: optional         | optional(test) 1.71 |
| Ubuntu 18.04     | :heavy_check_mark: v1.1.1| :question: optional         | optional(test) 1.65 |
| Ubuntu 16.04     | :heavy_check_mark: v1.0.2| :question: req.by openssl   | optional(test)      |
| Centos 7         | :heavy_check_mark: v1.0.2| :question: req.by openssl   | otpional(test) 1.53 |
src/library/os/linux/os_linux.cpp
@@ -91,7 +91,8 @@
    currentDrive = 0;
    while (NULL != (ent = getmntent(aFile))) {
        if ((strncmp(ent->mnt_type, "ext", 3) == 0 || strncmp(ent->mnt_type, "xfs", 3) == 0 ||
             strncmp(ent->mnt_type, "vfat", 4) == 0 || strncmp(ent->mnt_type, "ntfs", 4) == 0) &&
             strncmp(ent->mnt_type, "vfat", 4) == 0 || strncmp(ent->mnt_type, "ntfs", 4) == 0
                || strncmp(ent->mnt_type, "btr", 3) == 0) &&
            ent->mnt_fsname != NULL && strncmp(ent->mnt_fsname, "/dev/", 5) == 0) {
            if (stat(ent->mnt_fsname, &mount_stat) == 0) {
                drive_found = -1;
test/library/os_linux_test.cpp
@@ -23,12 +23,16 @@
        FUNCTION_RETURN result = getDiskInfos(NULL, &disk_info_size);
        BOOST_CHECK_EQUAL(result, FUNC_RET_OK);
        BOOST_CHECK_GT(disk_info_size, 0);
        diskInfos = (DiskInfo *)malloc(sizeof(DiskInfo) * disk_info_size);
        diskInfos = (DiskInfo*) malloc(sizeof(DiskInfo) * disk_info_size);
        result = getDiskInfos(diskInfos, &disk_info_size);
        BOOST_CHECK_EQUAL(result, FUNC_RET_OK);
        BOOST_CHECK_GT(mstrnlen_s(diskInfos[0].device, sizeof(diskInfos[0].device)), 0);
        BOOST_CHECK_GT(mstrnlen_s(diskInfos[0].label, sizeof diskInfos[0].label), 0);
        BOOST_CHECK_GT(diskInfos[0].disk_sn[0], 0);
        bool all_zero = true;
        for (int i = 0; i < diskInfos[0].disk_sn && all_zero; i++) {
            all_zero = (diskInfos[0].disk_sn[i] != 0);
        }
        BOOST_CHECK_MESSAGE(!all_zero, "disksn is not all zero");
        free(diskInfos);
    } else if (virt == LCC_API_VIRTUALIZATION_SUMMARY::CONTAINER) {
        // docker or lxc diskInfo is not meaningful
@@ -39,5 +43,5 @@
    }
}
}  // namespace test
}  // namespace license
} // namespace test
} // namespace license