diff options
Diffstat (limited to 'meta/lib/oeqa/runtime_cases/date.py')
-rw-r--r-- | meta/lib/oeqa/runtime_cases/date.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/meta/lib/oeqa/runtime_cases/date.py b/meta/lib/oeqa/runtime_cases/date.py deleted file mode 100644 index 6f3516a92f..0000000000 --- a/meta/lib/oeqa/runtime_cases/date.py +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | from oeqa.oetest import oeRuntimeTest | ||
2 | from oeqa.utils.decorators import * | ||
3 | import re | ||
4 | |||
5 | class DateTest(oeRuntimeTest): | ||
6 | |||
7 | def setUpLocal(self): | ||
8 | if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager") == "systemd": | ||
9 | self.target.run('systemctl stop systemd-timesyncd') | ||
10 | |||
11 | def tearDownLocal(self): | ||
12 | if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager") == "systemd": | ||
13 | self.target.run('systemctl start systemd-timesyncd') | ||
14 | |||
15 | @testcase(211) | ||
16 | @skipUnlessPassed("test_ssh") | ||
17 | def test_date(self): | ||
18 | (status, output) = self.target.run('date +"%Y-%m-%d %T"') | ||
19 | self.assertEqual(status, 0, msg="Failed to get initial date, output: %s" % output) | ||
20 | oldDate = output | ||
21 | |||
22 | sampleDate = '"2016-08-09 10:00:00"' | ||
23 | (status, output) = self.target.run("date -s %s" % sampleDate) | ||
24 | self.assertEqual(status, 0, msg="Date set failed, output: %s" % output) | ||
25 | |||
26 | (status, output) = self.target.run("date -R") | ||
27 | p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output) | ||
28 | self.assertTrue(p, msg="The date was not set correctly, output: %s" % output) | ||
29 | |||
30 | (status, output) = self.target.run('date -s "%s"' % oldDate) | ||
31 | self.assertEqual(status, 0, msg="Failed to reset date, output: %s" % output) | ||