diff --git a/meson.build b/meson.build index 56b59cd55c..0530d5aaae 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/test/testsuite/T2_FPOpenFork.c b/test/testsuite/T2_FPOpenFork.c.in similarity index 98% rename from test/testsuite/T2_FPOpenFork.c rename to test/testsuite/T2_FPOpenFork.c.in index b7f5de74bd..0d16887b19 100644 --- a/test/testsuite/T2_FPOpenFork.c +++ b/test/testsuite/T2_FPOpenFork.c.in @@ -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"); @@ -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"); } diff --git a/test/testsuite/data/meson.build b/test/testsuite/data/meson.build new file mode 100644 index 0000000000..017277cbff --- /dev/null +++ b/test/testsuite/data/meson.build @@ -0,0 +1,4 @@ +install_data( + 'test431_data', + install_dir: datadir / 'netatalk' / 'test-data', +) diff --git a/test/testsuite/data/test431_data b/test/testsuite/data/test431_data old mode 100755 new mode 100644 diff --git a/test/testsuite/meson.build b/test/testsuite/meson.build index 913d9444c3..155e9da860 100644 --- a/test/testsuite/meson.build +++ b/test/testsuite/meson.build @@ -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() @@ -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', @@ -162,6 +169,7 @@ spectest_sources = [ 'T2_Dircache_attack.c', 'T2_FPRead.c', 'T2_FPSetForkParms.c', + t2_fpopenfork_c, ] executable(