diff options
Diffstat (limited to 'test/appimage/main.c')
-rw-r--r-- | test/appimage/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/appimage/main.c b/test/appimage/main.c new file mode 100644 index 000000000..83c495183 --- /dev/null +++ b/test/appimage/main.c | |||
@@ -0,0 +1,32 @@ | |||
1 | // This is a simple hello program compiled on Debian 11 (glibc 2.31) | ||
2 | // and packaged as an appimage using appimagetool from | ||
3 | // https://github.com/AppImage/AppImageKit. The tool in installed | ||
4 | // in the current directory. | ||
5 | // | ||
6 | // Building the appimage: | ||
7 | // mkdir -p AppDir/usr/bin | ||
8 | // gcc -o AppDir/usr/bin/hello main.c && strip AppDir/usr/bin/hello | ||
9 | // ./appimagetool AppDir | ||
10 | |||
11 | |||
12 | #include <stdio.h> | ||
13 | #include <stdlib.h> | ||
14 | #include <unistd.h> | ||
15 | |||
16 | int main(int argc, char **argv) { | ||
17 | // test args | ||
18 | int i; | ||
19 | for (i = 1; i < argc; i++) | ||
20 | printf("%d - %s\n", i, argv[i]); | ||
21 | |||
22 | printf("Hello, World!\n"); | ||
23 | |||
24 | // elevate privileges - firejail should block it | ||
25 | system("ping -c 3 127.0.0.1\n"); | ||
26 | |||
27 | printf("Hello, again!\n"); | ||
28 | sleep(30); | ||
29 | |||
30 | return 0; | ||
31 | } | ||
32 | |||