Compare RTC and GTC to SNTP Tests (Compact 2013)

3/26/2014

The Real Time Clock (RTC) & GetTickCounter (GTC) to Simple Network Time Protocol (SNTP) Drift Test compares the RTC & GTC to an SNTP server to check for drift. This automated test can be used to replace the manual Wall Clock and RTC Drift Test.

On platforms where a software-emulated RTC is being used instead of an actual RTC, drift between the RTC and SNTP may cause this test to fail.

Test Prerequisites

Your device must meet the following requirements before you run this test.

The test should be run on a minimal OS design, such as one with only the following SYSGENs set to minimize the likelihood of interactions from other system components:

SYSGEN_NETWORKING=1

SYSGEN_SHELL=1

Requirement

Description

Real-time clock (RTC)

Corresponding to the GetSystemTime function

The following table shows the software requirements for the RTC & GTC to SNTP Drift Test.

Requirements

Description

Tux.exe

Tux test harness, required for executing the test

Kato.dll

Kato logging engine, required for logging test data

OalTestRtcDrift.dll

Library containing test files

The RTC & GTC to SNTP Drift Test requires Winsock support in the OS design, so SYSGEN_NETWORKING=1 must be set prior to building the run-time image that executes this test.

Subtests

The table below lists the subtests included in this test.

SubTest ID

Description

1

Timer Test Usage Message

Prints out the usage message for the RTC to NTP Drift Test. Tells the user what the test does and specifies the input if any that the user needs to provide to the test.

1000

Measures the drift on the RTC. The test compares the RTC on the target device to an external NTP timer server.

You can either specify the server name or use the list of default servers from the test. The test checks the list of servers and picks one that it can access and use. If you specify the query flag using -c "-q", the test walks through the default server list or, if specified, the servers given in the command line determining which have NTP that the test can access.

The servers can be specified on the command line by appending "-server name1,name2,name3", where nameX can be either an IP address (v4 only) or DNS. Do not insert spaces between server names.

The default run time for the test is 3 hours. This can be changed by appending "-sleepTime time" to the command line, where 'time' is the run time for the test. All values for 'time' are considered to be in seconds unless the following modifiers are used:

* s means seconds (12s = 12 seconds)

* m means minutes (12m = 12 minutes)

* h means hours (12h = 12 hours)

* d means days (12d = 12 days)

2000

Same as the 1000 sub-test but for the GTC timer.

Setting Up the Test

This test has no additional requirements, beyond the standard test environment setup.

Running the Test

You can modify the test by editing the command line for the test. To specify one or more of the following optional command line parameters for this test, use the -c command-line parameter. The -c parameter causesTux to pass the specified string to the test module. For more information about how to edit the command line for a test, see Editing the Command-Line for a Test.

The following table shows the command line parameters for the RTC to NTP Drift Test. The value 'time' is considered to be in seconds unless the following modifiers are used:

* s means seconds (12s = 12 seconds)

* m means minutes (12m = 12 minutes)

* h means hours (12h = 12 hours)

* d means days (12d = 12 days)

Command line parameter

Description

-q

Runs the test in query mode, causing it to iterate through the default server list or, if available, the servers specified using the '-server' parameter, and determine which have an NTP that the test can access.

-server name1,name2,...

Specifies the server list used by the -q parameter. The 'nameX' parameter can be either an IP address (v4 only) or a DNS. Note: The server list must not have any spaces between the server names. Use a comma (,) to separate server names.

-sleepTime time

Specifies the run time for the test.

Verifying the Test

When the test completes running, verify that "PASS" appears in the test log for all sub-tests.

Troubleshooting the Test

* Determine the point of failure and record the exact error message. If the source code is available, examine the point of failure in the code to see if any additional information can be gathered about the failure.

* Ensure SYSGEN_ETHERNET=1 is specified when building the image. A common cause of failure is the inability to reach the NTP time server. Attempt to execute the test using the -c "-q" command line to query the list of reachable NTP servers.

See Also

Other Resources

OAL - KITL, Memory, RTC Tests