Install.py: Prevent prompts from breaking apt

Change apt commands to prevent prompts from coming up (forcing
non-interactive mode) so things like grub or other stuff doesn't
break teuthology runs.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Fix: kdb: doesn't work on mira nodes

Change kernel.py to use ttyS2 for kdb output instead of ttyS1 when
the node is a mira machine. This is a fix for issue #4677
kernel.py: put submenu name in 01_ceph_kernel if necessary

We had been writing 01_ceph_kernel with the kernel title, and
relying on the fact that grub.cfg would never have submenus in it
(implemented by a hack to /etc/grub.d/10_linux which neutered its
submenu creation).  However, that hack was modifying a package file,
and got in the way of later apt commands.  Rather than doing it
that way, this divines the title of the submenu and sets the
default variable to "submenu>kernel", which works to select the
desired kernel.

It depends on there being only one level of submenu, and on the
format of the menuentry and submenu commands, dictated by grub2.
None of this is likely to work at all outside Ubuntu.

Fixes: #4496
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 52aec32a7da07ca6e9a22ecedde78dafb4b74dfc)
Revert "Install.py: Prevent prompts from breaking apt"

This reverts commit 5995ae7e78dd19f4036f891db9db9fec97d6eab5.

With the changes to ceph-qa-chef and the teuthology kernel task,
we're no longer touching packaged file /etc/grub.d/10_linux, which
was the reason for this apt forcing.  Remove so that we find other
package problems that might be masked by this; we can always
put it back if there are such problems until we can fix those as well.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit c2b0828b19a426c6d73cb2f614333200ae66bac3)
Revert "Revert "Install.py: Prevent prompts from breaking apt""

This reverts commit 67a616a97927efdc4fbcc5edb0d0cf4a724d90e2.

Sigh.  As it turns out, /etc/default/grub being hacked also
causes the same problem.  I think there's a way to fix that cleanly
as well, but until then, replacing the "accept installed version"
hack here so jobs can run.
scheduled_suite.sh: check clock skew at start and end of run

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 5c80201ec4a4a97367e4d7243cd046a3a8c808fa)
ceph-deploy: purge before archiving

Purge will uninstall and (in so doing) stop the daemons. This avoids trying
to tar up the mon data or logs while they are being written to, which
avoids errors like

2013-04-16T20:21:47.103 INFO:teuthology.task.ceph-deploy:Archiving mon data...
2013-04-16T20:21:47.545 INFO:teuthology.orchestra.run.err:tar: ./ceph-mira089/store.db/000009.log: file changed as we read it

Also drop the unnecessary uninstall (it is implied by purge).

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 4befae4fbea2413c9a8848ba195f336293619938)
misc: Use job id and make short path for testdir

Nightlies run on teuthology currently use a testdir of
/home/ubuntu/cephtest, but this causes stale job errors occasionally
from the previous tests not getting properly cleaned up, which prevents
the nightlies from running successfully.

The misc.py get_testdir() function can specify a testdir that is
specific to the job, but previously the path was too long and would
cause separate job failures.

This patch does two things to resolve that.  First, it uses the job id
from the teuthology run if one exists.  This should be a relatively
short number that will identify the job run effectively.  Second,
if the job id isn't available, it creates a shortened form of the
job's name, for example the job name:

teuthology-2013-04-09_23:51:49-rgw-next-testing-basic

becomes:

te1304092351rntb

Signed-off-by: Sam Lang <sam.lang@inktank.com>
lock: Fix import cycle breakage

fa2049f caused an import cycle between lock.py and misc.py.  Move the
needed functions from lock.py to lockstatus.py so that we can avoid the
import cycle.

Signed-off-by: Sam Lang <sam.lang@inktank.com>

Conflicts:
	teuthology/lock.py
misc: Fix name parsing

Use last two digits of year.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
misc: Use pythonic 'is not None' for jobid case

The conditional 'if global_jobid:' evaluates to true
in some cases even when global_jobid is None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
misc: Check for 'None' string from yaml

The description attribute from the machines yaml returned by the
locker might be the string 'None'.  Need to explicitly check for
that to avoid using a test dir of /tmp/cephtest/None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
radosgw-admin-rest: Add task for RESTful admin api.

Signed-off-by caleb miles <caleb.miles@inktank.com>
misc: Fix for case status['description'] == None

Skip the machine that has a description, but the
value is None.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
Merge branch 'next'

Conflicts:
	teuthology/lock.py
	teuthology/lockstatus.py
	teuthology/misc.py
	teuthology/task/install.py