Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

6 votes
4 answers
2817 views
How can we predict when the next Debian release will be out?
Is there a way to predict when the next release will be out? I read somewhere that it has to do with [number of bugs remaining in the testing branch][1]. Could someone please explain how this works and when the next release will happen based on what variables? [1]: https://bugs.debian.org/release-cr...
Is there a way to predict when the next release will be out? I read somewhere that it has to do with number of bugs remaining in the testing branch . Could someone please explain how this works and when the next release will happen based on what variables?
The Quantum Physicist (973 rep)
Apr 24, 2017, 11:42 AM • Last activity: Jul 31, 2025, 10:32 AM
0 votes
1 answers
33 views
How hid-generic driver catch the event from the mouse device
I have some questions regarding the hid-generic and implementing my own driver. Below is the hid-generic source code. [hid-generic.c source code][1] [1]: https://github.com/torvalds/linux/blob/master/drivers/hid/hid-generic.c My questions are: 1. How does the hid-generic driver report the behavior f...
I have some questions regarding the hid-generic and implementing my own driver. Below is the hid-generic source code. hid-generic.c source code My questions are: 1. How does the hid-generic driver report the behavior from the mouse to the kernel? > The source code is too simple. I cannot find which part provides this transformation. 2. What is the actual purpose of the raw_event function within the driver code? Is it necessary to have when implementing the device driver? 3. What would you recommend to set up a test environment for the HID device in order to make sure it functions correctly on a Raspberry Pi? Any tools used for testing in the industrial environment for the HID device driver?
Wen (11 rep)
Jun 23, 2025, 10:04 AM • Last activity: Jun 23, 2025, 05:58 PM
14 votes
2 answers
9115 views
Virtual Wayland Display Server Possible?
Are there any equivalents to X11's Xvfb for Wayland? So wayland applications can run with OpenGL etc without having to connect to a physical graphics card? --- Asking since I would like to run tests for graphical applications that can run on a headless server for example. Note: while it's technicall...
Are there any equivalents to X11's Xvfb for Wayland? So wayland applications can run with OpenGL etc without having to connect to a physical graphics card? --- Asking since I would like to run tests for graphical applications that can run on a headless server for example. Note: while it's technically possible to run wayland within a virtual X11 session, I'd rather not depend on this for my testing framework if possible.
ideasman42 (1461 rep)
Jun 10, 2021, 10:08 AM • Last activity: Jun 11, 2025, 11:05 PM
2 votes
2 answers
2805 views
How to use afl-fuzz (American Fuzzy Lop) with openssl
I am trying to use afl-fuzz with openssl in Ubuntu. A normal usage of afl-fuzz would be: afl-gcc test.c //-- this will produce a.out mkdir testcases echo "Test case here." > testcases/case1 afl-fuzz -i testcases -o findings ./a.out Now for openssl it would be something like: afl-gcc ./config make //...
I am trying to use afl-fuzz with openssl in Ubuntu. A normal usage of afl-fuzz would be: afl-gcc test.c //-- this will produce a.out mkdir testcases echo "Test case here." > testcases/case1 afl-fuzz -i testcases -o findings ./a.out Now for openssl it would be something like: afl-gcc ./config make //-- not sure of this :) afl-fuzz -i test -o findings where "test" is the folder with testcases for openssl My question is what is the parameter for "exe_name" for openssl? And please correct me if i'm wrong with the rest of the code. Thank you
Bigulinis (21 rep)
Jun 4, 2015, 05:15 AM • Last activity: Apr 9, 2025, 08:00 AM
0 votes
1 answers
1310 views
Testing using shell scripts
I am trying to write a shell script for testing my programs. I am having a few fundamental questions regarding it: * Goal: The shell script must be able to test certain programs and determine if they have passes the tests or failed them. * My approach: There are 2 things we need to deal with here->...
I am trying to write a shell script for testing my programs. I am having a few fundamental questions regarding it: * Goal: The shell script must be able to test certain programs and determine if they have passes the tests or failed them. * My approach: There are 2 things we need to deal with here-> the input to the program and the corresponding output from the program. Inorder to do this suppose we have I/O test files like: mytest.in and mytest.out and use them for testing * Question: My roadblocks here are- how do we pass in mytest.in to the program(say program.c) i.e how is input redirection done in this case. And after doing this, how can we get the output and compare it with those in mytest.out ? Notes: -> The input supplied to the files is through stdin, assume that the program doesn't take parameters through command line -> Assume that we use the shell script in this manner: ./testscript tests folder program It would be really nice if you could give an example demonstrating this.
Mathew (145 rep)
Oct 1, 2015, 07:04 PM • Last activity: Apr 7, 2025, 11:21 AM
4 votes
2 answers
808 views
How to write automated tests for zsh completion?
I have a project in which I automatically generate zsh completion functions. As I work on it, I've found corner cases and bugs which I'm just writing down and making sure to re-test when I make changes. Obviously, I want to write a proper testsuite, but I can't figure out how. For bash completions,...
I have a project in which I automatically generate zsh completion functions. As I work on it, I've found corner cases and bugs which I'm just writing down and making sure to re-test when I make changes. Obviously, I want to write a proper testsuite, but I can't figure out how. For bash completions, testing is quite easy -- set COMP_* variables, run the function, and check COMP_REPLY. I'd like to do something similar for zsh. I've read the compsys docs to the best of my ability, but I'm not seeing a solution. I'd like to set the context by hand, run my completions, and then see an array of descriptions or something. Has anyone found a way to test completions?
sirosen (143 rep)
Sep 11, 2021, 08:22 PM • Last activity: Feb 5, 2025, 06:06 PM
0 votes
0 answers
85 views
`metagoofil` is not working, or not as expected
When I type the command `metagoofil -d google.com -t doc -l 200 -n 50 -o store -f ~/foo.html`, I got the response `[*] Searching for 200 .doc files and waiting 30.0 seconds between searches` `[*] Results: 0 .doc files found` `[+] Done!` I tried the same for other websites, but the response was same....
When I type the command metagoofil -d google.com -t doc -l 200 -n 50 -o store -f ~/foo.html, I got the response
[*] Searching for 200 .doc files and waiting 30.0 seconds between searches
[*] Results: 0 .doc files found
[+] Done! I tried the same for other websites, but the response was same. I tried changing the connection, but without any expected change. So, what is actually the problem here? Why I am not able to get any files?
KeShAw (13 rep)
Feb 2, 2025, 08:46 PM
1 votes
1 answers
59 views
I fail to match the standard output of a posix shell function with the text I want to test it against
I want to test if the output of a function matches the text I envision it should write to standard output. But the code below never prints ```test PASS``` and I can't figure out why. I also tried putting various ```\n``` characters or deleting them in the variable ```GROUND_TRUTH``` but that didn't...
I want to test if the output of a function matches the text I envision it should write to standard output. But the code below never prints
PASS
and I can't figure out why. I also tried putting various
\n
characters or deleting them in the variable
but that didn't help.
error_out()
{
    printf "%s\n" "${ERROR}"
    printf "Return to exit\n"
    read -r THROW_AWAY
    exit
}

ERROR="Test output."
OUTPUT_TO_TEST=$(error_out)
GROUND_TRUTH="Test output.\nReturn to exit\n"
{ [ "${OUTPUT_TO_TEST}" = "${GROUND_TRUTH}" ] \
         && printf "error_out test PASS\n"; } \
    || { \
        printf "error_out test FAIL\n"; \
    }
branco (13 rep)
Dec 8, 2024, 09:25 PM • Last activity: Dec 9, 2024, 09:53 AM
269 votes
16 answers
278906 views
How to fill 90% of the free memory?
I want to do some [low-resources testing][1] and for that I need to have 90% of the free memory full. How can I do this on a `*nix` system? [1]: https://web.archive.org/web/20130131083626/http://www.allthingsquality.com/p/testing-terms-glossary.html
I want to do some low-resources testing and for that I need to have 90% of the free memory full. How can I do this on a *nix system?
Eduard Florinescu (12413 rep)
Nov 8, 2013, 10:13 AM • Last activity: Jul 30, 2024, 03:31 PM
15 votes
5 answers
25044 views
Is there a CD/DVD disk reading test tool for Linux?
When I was using DOS and Windows I've seen quite a selection of tools to check optical disks for readability and benchmark an optical drive itself. Most of them were even visualising the results in form of a pretty chart. Are there any such for GNU/Linux OSes? I'd prefer to have a full-featured visu...
When I was using DOS and Windows I've seen quite a selection of tools to check optical disks for readability and benchmark an optical drive itself. Most of them were even visualising the results in form of a pretty chart. Are there any such for GNU/Linux OSes? I'd prefer to have a full-featured visual GUI tool, but for the particular case I've got now, I just need to check if my CD drive can read every byte of a particular heavily-scratched CD-RW disk.
Ivan (18358 rep)
Jan 12, 2011, 12:00 AM • Last activity: May 19, 2024, 05:48 PM
22 votes
8 answers
20428 views
speedtest-cli: ValueError: invalid literal for int() with base 10: ''
On 3 machines I get: ~~~ $ speedtest-cli Retrieving speedtest.net configuration... Traceback (most recent call last): File "/usr/bin/speedtest-cli", line 11, in load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')() File "/usr/lib/python3/dist-packages/speedtest.py", line 198...
On 3 machines I get: ~~~ $ speedtest-cli Retrieving speedtest.net configuration... Traceback (most recent call last): File "/usr/bin/speedtest-cli", line 11, in load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')() File "/usr/lib/python3/dist-packages/speedtest.py", line 1986, in main shell() File "/usr/lib/python3/dist-packages/speedtest.py", line 1872, in shell speedtest = Speedtest( File "/usr/lib/python3/dist-packages/speedtest.py", line 1091, in __init__ self.get_config() File "/usr/lib/python3/dist-packages/speedtest.py", line 1173, in get_config ignore_servers = list( ValueError: invalid literal for int() with base 10: '' ~~~ I have tested one of these machines on two different internet connections with the same result. Why is it not working?
Ole Tange (37348 rep)
Apr 10, 2021, 01:39 PM • Last activity: Mar 8, 2024, 01:36 PM
0 votes
2 answers
130 views
Speeding up time flow for stability testing
Is it possible to speed up time flow in Linux system? Doesn't matter if virtualized or on bare metal. I need to test if my program could have uptime for ~10 years. So accelerating about 4000 times of the normal flow is necessary. Performance isn't my concern, since the program does most of the time...
Is it possible to speed up time flow in Linux system? Doesn't matter if virtualized or on bare metal. I need to test if my program could have uptime for ~10 years. So accelerating about 4000 times of the normal flow is necessary. Performance isn't my concern, since the program does most of the time nothing and waits for very sporadic inputs.
Libor Tomsik (107 rep)
Jan 22, 2024, 10:07 AM • Last activity: Jan 23, 2024, 01:52 PM
0 votes
1 answers
4818 views
Android Studio: Running application in emulator not working
Yesterday I downloaded Android Studio for my Debian Testing system. I wanted to run a HelloWorld application (just a blank activity) but weren't able to run it. With adb I can install it without having any problems. However, if I try to do it with Android Studio, it gets stuck on 'Installing APKs'....
Yesterday I downloaded Android Studio for my Debian Testing system. I wanted to run a HelloWorld application (just a blank activity) but weren't able to run it. With adb I can install it without having any problems. However, if I try to do it with Android Studio, it gets stuck on 'Installing APKs'. The same happens when I try to start it in an emulator (gets stuck on 'Waiting for target device to come online'). My device is a Samsung Galaxy S3 with LineageOS (Android 7.1.2) and root permissions. Android Studio recognizes my phone properly. What I've already done: - installed with openjdk - installed with oracle jdk - set android_home - installed all the SDK-platforms since Android 4.3 and Android Emulator from SDK tool - installed everything from SDK tool - enabled USB-debugging - tried with MTP and PTP - tried another emulated phone - installed lib32stdc++6 - restarted my computer - created new blank activity - reinstalled everything: JDK, Android SDK and Android Studio - and probably much more I do not get any error. Today I managed to have the emulator start by setting graphics to software but it just shows a black screen and doesn't power on. I tried to do it until now and couldn't find a solution. I have never experienced anything close to this on other systems. I really would like to get it running on Debian because I do not want to install Windows for this. I remember that I was able to run it on LMDE2 some time ago. So why doesn't it work on Debian Testing now? Did I forget something? Thank you in advance. **EDIT:** I am now able to use my phone to run the android application by using USB 2.0 instead of USB 3.0! Is that a normal behavior since it works with native adb? I mean, if I buy a new PC after some years which has got only USB 3.0 ports, will I not be able to use phone debugging with Android Studio or is this just an issue? It is still known since 2014 (https://stackoverflow.com/a/9548311/8292104) . However, I still cannot get the app running on an ADV. I changed graphics to software, now it shows the phone but the screen remains black and the phone won't start. What can I do to fix it?
tavkomann (103 rep)
Jul 12, 2017, 04:45 PM • Last activity: Dec 21, 2023, 05:37 PM
0 votes
1 answers
106 views
Get Test EXT2 IMG file
I have a task for university to deal with EXT2 file recovery. The problem is that the example drives (as IMG files) we got only contain one block group. I want to test if I read the drive correctly so I need more than one block group. I tried to create an IMG file from my Kubuntu USB drive but did n...
I have a task for university to deal with EXT2 file recovery. The problem is that the example drives (as IMG files) we got only contain one block group. I want to test if I read the drive correctly so I need more than one block group. I tried to create an IMG file from my Kubuntu USB drive but did not manage to do it. I searched online but found not a single IMG file to download. Google only wanted to sell some ext2 drivers to me. Where can I get an ext2 IMG file from?
Marcel Lorenz (123 rep)
Dec 17, 2023, 12:04 AM • Last activity: Dec 17, 2023, 01:04 AM
2 votes
1 answers
2814 views
How to intentionally corrupt my file system or crash its driver?
I am doing a research that involves **intentionally** corrupting my file system. I shouldn't be able to read or write anything to the file system after that. Therefore I am ok with crashing the drivers to the filesystem instead of corrupting the file system. Also, I am ok with my kernel freezing wit...
I am doing a research that involves **intentionally** corrupting my file system. I shouldn't be able to read or write anything to the file system after that. Therefore I am ok with crashing the drivers to the filesystem instead of corrupting the file system. Also, I am ok with my kernel freezing with it. Is there a set of operations, a standard way or a specific program that I can use to achieve this? It would be great if I can replicate the method in a non Linux environment as well (in GNU Hurd). Thanks in advance.
ravindroid00 (31 rep)
Nov 8, 2023, 12:49 AM • Last activity: Nov 12, 2023, 11:07 AM
0 votes
2 answers
155 views
How to figure out if CPU or GPU has been damaged by a thermal spike on Fedora
I have bought a new Asus Rog Strix laptop, and I ran on it Windows for a month without any issue. After I changed OS and putted Fedora 37 on it. My laptop has an NVidia 3060 with 6 GB (and a Ryzen 7 40000 series), and I was expecting compatibility out of the box with Fedora, I was wrong. After insta...
I have bought a new Asus Rog Strix laptop, and I ran on it Windows for a month without any issue. After I changed OS and putted Fedora 37 on it. My laptop has an NVidia 3060 with 6 GB (and a Ryzen 7 40000 series), and I was expecting compatibility out of the box with Fedora, I was wrong. After installing Fedora everything seemed ok, and so I left the laptop on standby in a bag for a couple of hours, once I returned I found the laptop inside the bag **really hot**, with almost all the battery drained and an endless amount of system errors. I quickly restarted it, and installed all the proprietary drivers, and after that I have experienced, in the following moths of use, absolutely no problems. Seems that the missing proprietary drivers were the culprits. Problem solved right? Kinda.. Since then I am afraid that the thermal spike could have damaged some of the hardware components. The laptop is working flawlessly as far I can tell from normal use, but I really would like to make sure that no hardware component was damaged during that incident. **So my question is:** *how can I know if the thermal spike caused damage to my hardware?* This question I think naturally divides itself into two subquestions: - Is it possible for a laptop running Linux (Fedora) to fry itself in a couple of hours? Aren't there some hardware/BIOS/UEFI safety mechanisms to prevent that? (Even if closed in a bag) - What is the best battery of test to run on Fedora to check for thermal hardware damage? And how can we compare our performance versus new hardware?
Noumeno (203 rep)
Mar 27, 2023, 10:15 AM • Last activity: Mar 29, 2023, 08:20 AM
2 votes
1 answers
1195 views
Allow udisksctl loop-setup without authentication for specific users
I have some tests that verify the behavior of a program under conditions where it runs out of disk space. Previously I've used `dd` to create a small-ish file then `mkfs` to make a filesystem on it, then used `sudo losetup` to mount it as a loopback device, then run my test (note, `/dev/full` is not...
I have some tests that verify the behavior of a program under conditions where it runs out of disk space. Previously I've used dd to create a small-ish file then mkfs to make a filesystem on it, then used sudo losetup to mount it as a loopback device, then run my test (note, /dev/full is not appropriate here: the test makes lots of files in a directory and it needs to start with space, then run out). But now I'm moving into a CI/CD environment where I don't have any sudo access for the account that will be running the tests so I need an alternative. I discovered udisksctl with loop-setup which works great on my system, but when I run it on the CI/CD systems I still get authorization errors: reading more closely it requires the user to be logged in, so a remote service doesn't appear sufficient. While I can't get full sudo access I could probably install a polkit exception to allow this account to manage loopback devices. I see /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy with various sections on managing loopback and I've read a number of SO questions that just say edit this file and allow any, which is probably not great. I've not been able to suss out exactly what to do here, is there some way to add a new file into /etc/polkit-1/localuthority somewhere for example that will allow me to specify that a specific user can manage loopback devices without sudo, without a login session (coming in over SSH, for example, or, in this case, invoked from a systemd service with a User= setting)? Or is this method of testing this situation just too complicated and there's something else people would recommend that would be simpler?
MadScientist (3218 rep)
Jun 17, 2022, 10:17 PM • Last activity: Mar 12, 2023, 09:07 AM
1 votes
1 answers
2548 views
Simulate touch manipulation on Linux
I'd like to test how well my Linux app works on Linux-based touch devices. Unfortunately, I don't have such a device, which is why I'd like to find a way to simulate touch gestures on a standard laptop. Is there a way to do that? How?
I'd like to test how well my Linux app works on Linux-based touch devices. Unfortunately, I don't have such a device, which is why I'd like to find a way to simulate touch gestures on a standard laptop. Is there a way to do that? How?
Tin Man (111 rep)
Feb 28, 2023, 01:22 AM • Last activity: Feb 28, 2023, 05:38 PM
0 votes
1 answers
687 views
Using Bash "=~" operator with WHILE instead of UNTIL loop
I'm writing some shell script which asks the user for a domain name. I'd like to prompt the user for input in a loop, and write an error message, if the input is not a valid domain name. Basically, the code shall look like this: ``` #!/bin/bash read -p "Enter domain name: " DOMAIN_NAME while [[ test...
I'm writing some shell script which asks the user for a domain name. I'd like to prompt the user for input in a loop, and write an error message, if the input is not a valid domain name. Basically, the code shall look like this:
#!/bin/bash
 
read -p "Enter domain name: " DOMAIN_NAME

while [[ testing for valid domain name goes here ]]
do
  echo ''
  echo 'You entered an invalid domain name. Please re-enter.'
  echo '... more error message data ....'
  echo ''
  read -p "Enter domain name: " DOMAIN_NAME
done

echo "You entered domain name: $DOMAIN_NAME"
I've found some examples that show how the "=~" operator can be used to test against a reqular expression. However, the examples all show UNTIL loops. Using the regex from the answer to question Check valid (sub)domain with regex in bash , an example is:
# !/bin/bash

until [[ "$DOMAIN_NAME" =~ ^([a-zA-Z0-9](([a-zA-Z0-9-]){0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,5}$ ]]
do
  read -p "Enter domain name: " DOMAIN_NAME
done

echo "You entered domain name: $DOMAIN_NAME"
While this works, it is not straitforward to write an additional error message in case the user entered invalid data. Such a message would have to be written inside the loop, before the read, but not on first iteration. For this reason I'd rather write the loop as a while loop as shown above. I'm unable to find how I can negate the test expresssion, which is needed when rewriting the until loop as a while loop.
phunsoft (178 rep)
Feb 24, 2023, 04:01 PM • Last activity: Feb 24, 2023, 05:07 PM
0 votes
0 answers
85 views
I know RPMs can have build dependencies, but can they also have testing dependencies?
At work we are developing a number of different software tools in different repositories, which get packaged as RPM files. Our suite of test data for unit and integration testing has now grown to the gigabytes, and rather than bodily import that into every RPM, we would like to have a dependency tha...
At work we are developing a number of different software tools in different repositories, which get packaged as RPM files. Our suite of test data for unit and integration testing has now grown to the gigabytes, and rather than bodily import that into every RPM, we would like to have a dependency that is only triggered when performing tests. That is, some of our testers will not need the test-data repository. They will update the code repository, run rpmbuild --nocheck, and test the result by hand (such as user-interface testing, which we haven't automated). Other folks in QA will download the code repository, run 'rpmbuild' and should be told if their installed test-data RPM is sufficiently recent or not. For our production build robot, we want it to be able to examine the dependencies, download any needed updates, run all tests, and package the final output for shipment. Is this even possible? The RPM specs I can find say almost nothing about testing environments, or use of %check.
swestrup (101 rep)
Aug 3, 2022, 04:27 PM • Last activity: Aug 3, 2022, 04:44 PM
Showing page 1 of 20 total questions