[Automated-testing] Functional.logrotate use of ntpdate

Tim.Bird at sony.com Tim.Bird at sony.com
Tue Nov 19 05:56:22 PST 2019


Wang,

I was trying to test Functional.logrotate in my lab, and ran into some difficulties.
The sub-test tests/logrotate_rotation.sh uses ntpdate, and there is an
'assert_has_program ntpdate' in fuego_test.sh.

I have a few machines in my lab that have logrotate, but not ntpdate.
Because of the assertion, and the use of ntpdate, I can't run this test.

What is ntpdate being used for in logrotate_rotations.sh?

It's not clear.  it is used with $test_host, which is set from $SRV_IP
in fuego_test.sh.  Does this imply that the Fuego host is supposed
to act as an ntp host?  I don't know if that's going to be true or
not.  Are most Linux machine's ntp hosts by default?  Is this a normal
thing?

It looks like maybe this is to synchronize the time between the host
and the target.  I'm not sure why this is needed.  Also, if a test changes
the date and time on a target board, it should restore the original
date and time when it completes.  The goal of every test is to leave
the system in the same (or as close to the same) condition as when
it started.  I have a few boards that don't have realtime clocks, and
so always start with a date of Janary 1, 2000 (or something like that).
It's probably uncommon for a machine to act weirdly when configured
with the correct time, but there are time-based operations which might
be disturbed if there are big jumps in system time, or if system time
on a board is wildly different for one set of tests versus another.

Based on my current understanding, I'm inclined to just remove the
call to ntpdate (and the related assert_has_program),
but let me know what you think.
 -- Tim






More information about the automated-testing mailing list