AFP_SPECTEST(1)
๐ NAME ๐
Hey bestie! ๐ This is the AFP_SPECTEST(1) page from the Netatalk AFP Fileserver Manual, and it's all about afp_spectest, the AFP specification compliance test suite โจ
๐ SYNOPSIS ๐
Okay, here's how you call it:
afp_spectest [-1234567aCEimVv] [-h host] [-H host2] [-p port] [-s
volume] [-c path to volume] [-S volume2] [-u user] [-d user2] [-w
password] [-f test]
afp_spectest -l
๐ธ DESCRIPTION ๐ธ
afp_spectest is a comprehensive AFP specification test suite with several hundreds of test cases ๐คฏ The tests are sorted into testsets, grouped either by the AFP command being tested or by the preconditions needed to test it ๐ง
You can see every available testset with -l. Want to run a single test or a whole testset? Use -f ๐ฆ
โจ OPTIONS โจ
Okay, the options are where it gets spicy ๐ถ๏ธ Here's the whole menu:
-1โ Uses the AFP 2.1 protocol version ๐ซ-2โ Uses the AFP 2.2 protocol version ๐ซ-3โ Uses the AFP 3.0 protocol version ๐ซ-4โ Uses the AFP 3.1 protocol version ๐ซ-5โ Uses the AFP 3.2 protocol version ๐ซ-6โ Uses the AFP 3.3 protocol version ๐ซ-7โ Uses the AFP 3.4 protocol version. This one's the default ๐-aโ Tells the test runner that the server under test stores AppleDouble v2 metadata, not filesystem EA ๐๏ธ-c pathโ The local filesystem path to the test volume. You need this for tier 2 tests ๐ ๏ธ-Cโ Turns off ANSI colors in the terminal output. No rainbows for you ๐-d userโ A second username for logging in to the AFP server ๐ฏ-Eโ Empties the test volume before the tests run ๐งน
WARNING: This will delete all files and directories in the test volume! Do NOT point this at a volume you actually care about ๐
-f testโ Picks the test or testset you want to run ๐ฏ-h hostโ The server hostname or IP address. It defaults tolocalhost๐-H hostโ The server hostname or IP address for the second host ๐ฅ๏ธ-iโ Interactive mode! It asks you before each test. Mostly for debugging ๐-lโ Lists every available testset, then exits ๐-mโ Runs the tests in AppleShare (Mac) AFP server compatibility mode ๐-p portโ The server port number. The default is548๐-s volumeโ The volume name to mount for testing ๐-S volumeโ The volume name for a second volume to mount for testing ๐-u userโ The username for logging in to the AFP server. It defaults to the current uid ๐-vโ Verbose output ๐ฃ-Vโ Very verbose output. Extra chatty, extra iconic ๐ข-w passwordโ The password for logging in to the AFP server ๐
๐ง USAGE ๐ง
Every test in the spectest suite follows the same general pattern and parameters. Some tests need extra required parameters or preconditions, though ๐ค First you set the AFP protocol version (-1 through -7), then you give the address and credentials of the host you're testing. That host can be localhost. Some tests also need a second user and a second volume defined ๐ฏโโ๏ธ
The so-called tier 2 (T2) tests have to run from localhost, and you have to give the local path to the volume under test with -c. Why? They modify the file system directly with system calls, both to set up preconditions and to check results ๐ ๏ธ
There are also read-only and sleep tests, and those have to be run separately ๐ซถ
๐ฎ Extension mapping tests
A handful of tests in the FPGetFileDirParms testset expect the filename extension to Classic Mac OS Type/Creator mapping to be turned on. In version 3 and later of netatalk, you have to enable this yourself by editing extmap.conf(5). Uncomment the lines for the mappings you want in that configuration file ๐
๐ด Sleep tests
The FPzzz testset holds tests for AFP sleep mode and timeouts. These take way longer than everything else, so they're not included when you run the full spectest suite ๐ข You have to run that testset on its own with -f:
afp_spectest -f FPzzz
๐ Readonly tests
As the name suggests, the Readonly testset checks how netatalk behaves when the shared volume is in read-only mode ๐
Obviously, the volume you test has to be configured as read-only. You can do that by setting read only = yes in afp.conf, for example:
[test volume]
path = /my/path
volume name = test_volume
read only = yes
The tests expect at least two files and one directory in the read-only shared volume. Set that up like this:
echo "testfile uno" > /my/path/first.txt
echo "testfile dos" > /my/path/second.txt
mkdir /my/path/third
Then run the Readonly testset:
afp_spectest -s test_volume -f Readonly
๐ฆ Return codes
Each test in a testsuite returns one of these return codes:
0โ PASSED ๐1โ FAILED ๐ญ2โ NOT TESTED ๐ซ3โ SKIPPED ๐
NOT TESTED means a test setup step or precondition check failed. This return code flags the whole test run as failed, so it's a big deal ๐
SKIPPED means the test doesn't apply to the AFP server you're testing, or a parameter the test needs is missing. Check the test report for the specific reason it got skipped. This one won't count against your test run โจ
๐ Testing an AppleShare AFP server
This suite was designed mainly for Netatalk AFP servers, but it can also test an AppleShare AFP server hosted by an older Mac OS X or Classic Mac OS system ๐
To test an AppleShare server, launch the test runner with the -m (Mac) option. In this mode, the runner reports tests with known current or historical differences between AppleShare and Netatalk ๐
If AppleShare and Netatalk differ, or if AppleShare results differ between versions, you'll see something like this:
header.dsi_code -5000 AFPERR_ACCESS
MAC RESULT: -5019 AFPERR_PARAM -5010 AFPERR_BUSY
Netatalk returns AFPERR_ACCESS when a Mac return AFPERR_PARAM or AFPERR_BUSY
When AppleShare and Netatalk used to return different results but now behave the same way, you'll get this:
Warning MAC and Netatalk now same RESULT!
Apart from these cases, the spectest should return the same results whether you run it against a native AppleShare AFP server or against Netatalk ๐ซถ
๐ EXAMPLES ๐
โ๏ธ Configure environment
Here's a sample setup for running the AFP spec tests. Right now, the test runner only supports ClearTxt and Guest authentication ๐
- 2 users:
user1anduser2, with the same password - 1 group:
afpusers user1anduser2are both in theafpusersgroup
Arrange two empty directories. Some tests will fail if there are leftover files in the test directories ๐งน
drwxrwsr-x 5 user1 afpusers 176 avr 27 23:56 /tmp/afptest1
drwxrwsr-x 5 user1 afpusers 176 avr 27 23:56 /tmp/afptest2
Then set up afp.conf like this:
[Global]
uam list = uams_clrtxt.so uams_guest.so
[testvol1]
ea = sys
path = /tmp/afptest1
valid users = @afpusers
volume name = testvol1
[testvol2]
ea = sys
path = /tmp/afptest2
valid users = @afpusers
volume name = testvol2
๐โโ๏ธ Running tests
Let's run afp_spectest against the AFP server on 10.0.0.10, using the FPSetForkParms_test testset with AFP 3.4 ๐
% afp_spectest -h 10.0.0.10 -u user1 -d user2 -w passwd -s testvol1 -S testvol2 -c /srv/afptest1 -7 -f FPSetForkParms_test
===================
FPSetForkParms_test
-------------------
FPSetForkParms:test62: SetForkParams errors - PASSED
FPSetForkParms:test141: Setforkmode error - PASSED
FPSetForkParms:test217: Setfork size 64 bits - PASSED
FPSetForkParms:test306: set fork size, new size > old size - PASSED
๐ SEE ALSO ๐
Check out these friends too ๐ง
That's the whole tea, bestie! ๐ซถ This page came from Netatalk 4.5.1, and it's AFP_SPECTEST(1) all the way through. Stay iconic and keep testing ๐โจ
๐ฆ where this page comes from
- fedora 44: netatalk-afptest 5:4.5.1-1.fc44 ยท GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-BSD AND FSFUL AND LicenseRef-Callaway-MIT
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms