<?xml version="1.0" encoding="UTF-8"?>
<refentry id="afptest.1">
  <refmeta>
    <refentrytitle>afptest</refentrytitle>

    <manvolnum>1</manvolnum>

    <refmiscinfo class="date">27 October 2024</refmiscinfo>

    <refmiscinfo class="source">Netatalk</refmiscinfo>

    <refmiscinfo class="manual">Netatalk AFP Fileserver Manual</refmiscinfo>

    <refmiscinfo class="version">@netatalk_version@</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>afptest</refname>

    <refname>afp_lantest</refname>

    <refname>afp_logintest</refname>

    <refname>afp_spectest</refname>

    <refname>afp_speedtest</refname>

    <refname>afparg</refname>

    <refpurpose>AFP protocol tests</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>afp_lantest<indexterm>
          <primary>afptest</primary>
        </indexterm></command>

      <arg>-34567GgVv</arg>

      <arg>-h <replaceable>host</replaceable></arg>

      <arg>-p <replaceable>port</replaceable></arg>

      <arg>-s <replaceable>volume</replaceable></arg>

      <arg>-u <replaceable>user</replaceable></arg>

      <arg>-w <replaceable>password</replaceable></arg>

      <arg>-n <replaceable>iterations</replaceable></arg>

      <arg>-t <replaceable>tests</replaceable></arg>

      <arg>-F <replaceable>bigfile</replaceable></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>afp_logintest<indexterm>
          <primary>afptest</primary>
        </indexterm></command>

      <arg>-1234567CmVv</arg>

      <arg>-h <replaceable>host</replaceable></arg>

      <arg>-p <replaceable>port</replaceable></arg>

      <arg>-s <replaceable>volume</replaceable></arg>

      <arg>-u <replaceable>user</replaceable></arg>

      <arg>-w <replaceable>password</replaceable></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>afp_spectest<indexterm>
          <primary>afptest</primary>
        </indexterm></command>

      <arg>-1234567aCiLlmVvXx</arg>

      <arg>-h <replaceable>host</replaceable></arg>

      <arg>-H <replaceable>host2</replaceable></arg>

      <arg>-p <replaceable>port</replaceable></arg>

      <arg>-s <replaceable>volume</replaceable></arg>

      <arg>-c <replaceable>path to volume</replaceable></arg>

      <arg>-S <replaceable>volume2</replaceable></arg>

      <arg>-u <replaceable>user</replaceable></arg>

      <arg>-d <replaceable>user2</replaceable></arg>

      <arg>-w <replaceable>password</replaceable></arg>

      <arg>-f <replaceable>test</replaceable></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>afp_speedtest<indexterm>
          <primary>afptest</primary>
        </indexterm></command>

      <arg>-1234567aeiLnVvy</arg>

      <arg>-h <replaceable>host</replaceable></arg>

      <arg>-p <replaceable>port</replaceable></arg>

      <arg>-s <replaceable>volume</replaceable></arg>

      <arg>-S <replaceable>volume2</replaceable></arg>

      <arg>-u <replaceable>user</replaceable></arg>

      <arg>-w <replaceable>password</replaceable></arg>

      <arg>-n <replaceable>iterations</replaceable></arg>

      <arg>-d <replaceable>size</replaceable></arg>

      <arg>-q <replaceable>quantum</replaceable></arg>

      <arg>-F <replaceable>file</replaceable></arg>

      <arg>-f <replaceable>test</replaceable></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>afparg<indexterm>
          <primary>afptest</primary>
        </indexterm></command>

      <arg>-1234567lVv</arg>

      <arg>-h <replaceable>host</replaceable></arg>

      <arg>-p <replaceable>port</replaceable></arg>

      <arg>-s <replaceable>volume</replaceable></arg>

      <arg>-u <replaceable>user</replaceable></arg>

      <arg>-w <replaceable>password</replaceable></arg>

      <arg>-f <replaceable>command</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <para>All of the tools in the <emphasis remap="I">afptest</emphasis>
    family follow the same general usage pattern and parameters. You set the
    AFP protocol revision (<option>-1</option> through <option>-7</option>),
    then the address and credentials of the host to test (which can be
    localhost). Some tests require a second user and second volume to be
    define. Yet another set of tests must be run from localhost, and the local
    path to the volume under test to be provided. Single tests or test
    sections can be executed with the <option>-f</option> option. Available
    tests can be listed with the <option>-l</option> option.</para>

    <para><command>afp_spectest</command> makes up the core of the AFP
    specification test suite, with just over 300 test cases. It is organized
    into testsets, divided by AFP commands tested, or by preconditions for
    testing. For instance, the tier 2 (T2) tests need to be run on the host
    with the <option>-c</option> option indicating the path to the shared
    volume. There are also read-only and sleep tests that need to be run
    separately.</para>

    <para><command>afp_logintest</command> is an AFP login authentication test
    suite that has its own runners.</para>

    <para><command>afp_lantest</command> and <command>afp_speedtest</command>
    are file transfer benchmarks for AFP servers. The former is inspired by
    <emphasis remap="I">HELIOS LanTest</emphasis>, which runs a batch of
    varied file transfer patterns. The latter is a simpler tool with a handful
    of available test cases.</para>

    <para><command>afparg</command> is an AFP CLI client that takes a specific
    command with optional arguments, and sends a single action to the AFP
    server. This can be used for one-off troubleshooting or system
    administration.</para>

    <para>Please refer to the helptext of each tool for the precise use of
    each option.</para>
  </refsect1>

  <refsect1>
    <title>Example</title>

    <para>Run the afp_spectest for the "FPSetForkParms_test" testset with
    AFP 3.4.</para>

    <screen><prompt>%</prompt> <userinput>afp_spectest -h 127.0.0.1 -p 548 -u user1 -d user2 -w passwd -s testvol1 -S testvol2 -c /srv/afptest1 -7 -f FPSetForkParms_test</userinput>
<computeroutput>===================
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 &gt; old size - PASSED</computeroutput>
</screen>

    <para>Run the afp_lantest benchmark using AFP 3.0.</para>

    <screen><prompt>%</prompt> <userinput>afp_lantest -h 192.168.0.2 -s testvol1 -u user1 -w passwd -3</userinput>
<computeroutput>Run 0 =&gt; Opening, stating and reading 512 bytes from 1000 files   1799 ms
Run 0 =&gt; Writing one large file                                     30 ms for 100 MB (avg. 3495 MB/s)
Run 0 =&gt; Reading one large file                                      8 ms for 100 MB (avg. 13107 MB/s)
Run 0 =&gt; Locking/Unlocking 10000 times each                       1959 ms
Run 0 =&gt; Creating dir with 2000 files                             1339 ms
Run 0 =&gt; Enumerate dir with 2000 files                             217 ms
Run 0 =&gt; Create directory tree with 10^3 dirs                      496 ms

Netatalk Lantest Results (averages)
===================================

Opening, stating and reading 512 bytes from 1000 files   1799 ms
Writing one large file                                     30 ms for 100 MB (avg. 3495 MB/s)
Reading one large file                                      8 ms for 100 MB (avg. 13107 MB/s)
Locking/Unlocking 10000 times each                       1959 ms
Creating dir with 2000 files                             1339 ms
Enumerate dir with 2000 files                             217 ms
Create directory tree with 10^3 dirs                      496 ms</computeroutput>
</screen>
  </refsect1>

  <refsect1>
    <title>See also</title>

    <para><citerefentry>
        <refentrytitle>afpd</refentrytitle>

        <manvolnum>8</manvolnum>
      </citerefentry>.</para>
  </refsect1>

  <refsect1>
    <title>Author</title>

    <para>See <ulink url='https://netatalk.io/contributors'>CONTRIBUTORS</ulink></para>
  </refsect1>
</refentry>
