The PPP package additionally contains a shell script (test_server.sh) that may be used to operate the remote end of a PPP test link.
The script may be invoked with the following arguments:
This mandatory option gives the name of the device to be used for the PPP link. Typically "/dev/ttyS0" or "/dev/ttyS1".
This mandatory option gives the IP address to be attached to this end of the PPP link.
This mandatory option gives the IP address to be attached to the remote (test target) end of the PPP link.
This option gives the baud rate at which the PPP link is to be run. If absent then the link will run at the value set for --redboot-baud.
If this option is present then the script will look for a "RedBoot>" prompt between test runs. This is necessary if the serial device being used for testing is also used by RedBoot.
This option gives the baud rate at which the search for the RedBoot prompt will be made. If absent then the link will run at 38400 baud.
If this option is present, then the script will print out some additional debug messages while it runs.
This script operates as follows: If the --redboot option is set it sets the device baud rate to the RedBoot baud rate and waits until a "RedBoot>" prompt is encountered. It then sets the baud rate to the value given by the --baud option and reads lines from the device until a recognizable test announce string is read. It then executes an appropriate set of commands to satisfy the test. This usually means bringing up the PPP link by running pppd and maybe executing various commands. It then either terminates the link itself, or waits for the target to terminate it. It then goes back to looking for another test announce string. If a string of the form "BAUD:XXX" is received then the baud rate is changed depending on the XXX value. If a "FINISH" string is received it returns to waiting for a "RedBoot>" prompt. The script repeats this process until it is terminated with a signal.