Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite: Install test data for test431 into the datadir #1712

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,7 @@ endif
cdata.set('bindir', bindir)
cdata.set('etcdir', pkgconfdir)
cdata.set('exec_prefix', exec_prefix)
cdata.set('datadir', datadir)
cdata.set('homedir', homedir)
cdata.set('libdir', libdir)
cdata.set('includedir', includedir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1349,19 +1349,21 @@ STATIC void test431()

ENTER_TEST

if (!Test) {
if (!Quiet) {
fprintf(stdout, "test431_data must be present in volume.\n");
}
test_skipped(T_SINGLE);
// FIXME: Fails specifically on Alpine Linux
if (Exclude) {
test_skipped(T_EXCLUDE);
goto test_exit;
}
if (!Mac && Path[0] == '\0') {
test_skipped(T_MAC_PATH);
goto test_exit;
}
if (Conn->afp_version < 31) {
test_skipped(T_AFP31);
goto test_exit;
}

/* touch resource_fork_conversion_test base file */
/* touch resource fork conversion test base file */
if (snprintf(cmd, sizeof(cmd), "touch %s/%s", Path, name) > sizeof(cmd)) {
if (!Quiet) {
fprintf(stdout,"FPOpenFork:test431: path too long\n");
Expand All @@ -1388,7 +1390,7 @@ STATIC void test431()
}

/* Copy resource fork */
if (snprintf(cmd, sizeof(cmd), "mv %s/test431_data %s/.AppleDouble/%s", Path, Path, name) > sizeof(cmd)) {
if (snprintf(cmd, sizeof(cmd), "cp @datadir@/netatalk/test-data/test431_data %s/.AppleDouble/%s", Path, name) > sizeof(cmd)) {
if (!Quiet) {
fprintf(stdout,"FPOpenFork:test431: path too long\n");
}
Expand Down
4 changes: 4 additions & 0 deletions test/testsuite/data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
install_data(
'test431_data',
install_dir: datadir / 'netatalk' / 'test-data',
)
Empty file modified test/testsuite/data/test431_data
100755 → 100644
Empty file.
10 changes: 9 additions & 1 deletion test/testsuite/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
subdir('data')

t2_fpopenfork_c = configure_file(
input: 'T2_FPOpenFork.c.in',
output: 'T2_FPOpenFork.c',
configuration: cdata,
)

afptest_external_deps = []

if threads.found()
Expand Down Expand Up @@ -151,7 +159,6 @@ spectest_sources = [
'T2_FPDelete.c',
'T2_FPGetFileDirParms.c',
'T2_FPGetSrvrParms.c',
'T2_FPOpenFork.c',
'T2_FPSetDirParms.c',
'T2_FPSetFileParms.c',
'T2_FPMoveAndRename.c',
Expand All @@ -162,6 +169,7 @@ spectest_sources = [
'T2_Dircache_attack.c',
'T2_FPRead.c',
'T2_FPSetForkParms.c',
t2_fpopenfork_c,
]

executable(
Expand Down
Loading