As observed in previous chapters, we have manually installed Linyaps packages and launched applications to verify compatibility. However, this raises a question: As the number of applications requiring testing increases, does manual testing become inefficient? To address this, we introduce Linyaps Automated Testing Toolchains — Next Linyaps Testing Toolchains, open-sourced and available to all ecosystem contributors.

Project Overview

Next Linyaps Testing Toolchains is a shell script-based testing framework designed to streamline Linyaps application validation. This project inherits the spirit of linglong-automan and remains permanently open-source.

Implemented Features

  1. Organize scattered *binary.layer files into standardized directory structures (xxx/id/package) and generate two CSV files recording Linyaps application IDs and versions.
  2. Batch installation of organized Linyaps packages.
  3. Simulate application launches via desktop files based on:
    • Installation status
    • Desktop file existence
    • Window creation status Capture screenshots of test results. * Some features depend on deepin 23 components and require adaptation for other distributions.
  4. Scan installed Linyaps applications to verify XDG-compliant icon directories and collect icons.
  5. Batch uninstallation of Linyaps applications.

Code Structure Analysis

The toolchain consists of modular scripts:

  1. linyaps-auto-optimize.sh: Organizes binary.layer files and generates:
org.qbittorrent.qBittorrent/package/org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer  
com.poki.apple-knight-golf.linyaps/package/com.poki.apple-knight-golf.linyaps_28.3.3.2_x86_64_binary.layer  

ll-pkg-name.csv

org.qbittorrent.qBittorrent  
com.poki.apple-knight-golf.linyaps  

ll-pkg-version.csv

4.6.7.22  
28.3.3.2  
  1. linyaps-auto-install-release.sh: Batch installation tool for organized packages.
  2. linyaps-auto-screenshot-deepin23.sh: Automated testing with screenshot capture (deepin 23 only).
  3. linyaps-auto-screenshot-general.sh: Cross-distro testing without screenshots.
  4. linyaps-auto-uninstall-release.sh: Batch uninstallation tool.

Practical Use of Next Linyaps Testing Toolchains

After introducing the overall functionality and code logic, we demonstrate how to use the “Linyaps Application Automated Testing Suite” to perform batch testing on linyaps application packages binary.layer produced in previous lessons, based on deepin 23.

Environment Preparation

Before using the testing suite, ensure your environment meets the following conditions:

  1. Some functionalities of the self-service compatibility testing suite used in this practical session require the Linux x11 window management tool. Therefore, install the following packages before use: wmctrl x11-utils
  2. The testing suite uses the x11 window management tool to determine the application window startup status, so ensure your system is an x11 environment rather than a Wayland environment.
  3. The wmctrl and xwininfo components can function properly, and you can query window information using xwininfo.
  4. Since deepin 23 provides screenshot functionality for compatibility testing results, install the relevant packages:deepin-screen-recorder imagemagick-6.q16
  5. Manually start deepin-screen-recorder once, and ensure the system screenshot save path is the current user’s ~/Pictures/Screenshots, and that this directory is empty.

Starting the Testing Functionality

  1. In the previous practical lesson, we obtained the linyaps installation package org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer for qBittorrent--4.6.7. For demonstration purposes, I have found another installation package.

2. Now, with two linyaps application installation packages, first execute the linyaps-auto-optimize.sh script to organize the directory. This script primarily uses two parameters to point to the directory where the linyaps application installation packages binary.layer are stored ($ll_origin_pool) and the destination directory for organization ($ll_stored_pool).

3. I have created two separate directories locally, ll-bins and ll-pool, to point to $ll_origin_pool and $ll_stored_pool. The directory structure of ll-bins is as follows:

├── ll-bins
│   ├── org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer
│   └── com.poki.apple-knight-golf.linyaps_28.3.3.2_x86_64_binary.layer

4. Execute the directory organization operation:

ziggy@linyaps23:/media/szbt/Data/linyaps-testing-toolchains$ ./linyaps-auto-optimize.sh ./ll-bins ./ll-pool

After organization, the directory structure is as follows:

ll-pool/
├── org.qbittorrent.qBittorrent
│   └── package
│       └── org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer
└── com.poki.apple-knight-golf.linyaps
  └── package
      └── com.poki.apple-knight-golf.linyaps_28.3.3.2_x86_64_binary.layer

5. After directory organization, two tables are generated to record application information: ll-pkg-name.csv and ll-pkg-version.csv. We merge the two columns into a new table ll-pkg-info.csv:

ll-pkg-info.csv

org.qbittorrent.qBittorrent,4.6.7.22
com.poki.apple-knight-golf.linyaps,28.3.3.2

6. Based on this file, we can start batch-installing linyaps applications. This script primarily uses one parameter to point to the organized destination directory $ll_stored_pool:

ziggy@linyaps23:/media/szbt/Data/linyaps-testing-toolchains$ linyaps-auto-install-release.sh ./ll-pool

7. After installing linyaps applications and completing all prerequisites, we can initiate the testing process. Here, we create a new res directory to store test result resources such as icons and screenshots.

8. Open a terminal in the graphical interface and execute the screenshot script. Since we are in a deepin 23 x11 environment with necessary programs installed, run linyaps-auto-screenshot-deepin23.sh. This script primarily uses two parameters to point to the directory for test result resources $ll_res_pool and the application information table $ll_pkgname_list, which refers to the new table ll-pkg-info.csv obtained in the previous step:

ziggy@linyaps23:/media/szbt/Data/linyaps-testing-toolchains$ ./linyaps-auto-screenshot-deepin23.sh ./res ./ll-pkg-info.csv

*Remember, this script must be executed in a graphical terminal; otherwise, it cannot properly initiate the process.

9. After launching the script, minimize the terminal window and keep it running in the background. The testing suite will determine the application installation status and desktop file existence to “launch” and “close” application windows.

10. Once the operation requirements are met, the suite will simulate launching the program via the desktop file and, after approximately a 30-second delay, judge whether a new window has been created after the application starts.

11. After the application runs successfully, it will sequentially complete screenshotting, icon detection, and acquisition operations.

12. After testing is complete, you can see tables of different statuses and test result materials in the res directory. Since both applications passed the compatibility test, they will be recorded in all-good.csv. Otherwise, two abnormal situations may occur:

a. Applications that fail to generate a window within the timeout period will be written to the failed.csv file, indicating that the application failed to start.

b. If the linyaps application directory does not contain an icon file, it will be written to the icons-missing.csv file, as it does not meet the specifications for graphical applications in the Linyaps community.

res/
├── all-good.csv
├── com.poki.apple-knight-golf.linyaps
│   ├── icons
│   │   └── com.poki.apple-knight-golf.png ## Application icon file
│   └── screenshots ## Application compatibility test screenshots
│       ├── 1.png
│       ├── 2.png
│       └── 3.png
└── org.qbittorrent.qBittorrent
  ├── icons
  │   ├── qbittorrent.png
  │   └── qbittorrent.svg
  └── screenshots
      ├── 1.png
      ├── 2.png
      └── 3.png

Thus, we have successfully completed compatibility testing of the linyaps applications produced in previous lessons using the Linyaps Application Automated Testing Suite.