* [PATCH] oeqa/runtime: Added 4 new runtime test cases
@ 2015-07-08 15:17 Daniel Istrate
2015-07-10 22:41 ` Burton, Ross
2015-07-15 7:43 ` ChenQi
0 siblings, 2 replies; 4+ messages in thread
From: Daniel Istrate @ 2015-07-08 15:17 UTC (permalink / raw)
To: openembedded-core
bash: (240) check bash in image
connman: (223) Only one connmand in background
(963) test connmand file
rpm: (195) Check rpm install/removal log file size
Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
---
meta/lib/oeqa/runtime/bash.py | 23 +++++++++++++++++++++++
meta/lib/oeqa/runtime/connman.py | 40 ++++++++++++++++++++++++++++++++++++++++
meta/lib/oeqa/runtime/rpm.py | 37 +++++++++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+)
create mode 100644 meta/lib/oeqa/runtime/bash.py
diff --git a/meta/lib/oeqa/runtime/bash.py b/meta/lib/oeqa/runtime/bash.py
new file mode 100644
index 0000000..2a261a3
--- /dev/null
+++ b/meta/lib/oeqa/runtime/bash.py
@@ -0,0 +1,23 @@
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+
+class BashTest(oeRuntimeTest):
+
+ @testcase(240)
+ @skipUnlessPassed("test_ssh")
+ def test_check_bash_in_image(self):
+ """
+ Summary: check bash in image
+ Expected: bash command should exist in image
+ Product: BSPs
+ Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ cmd = 'which bash'
+ expected_ret = '/bin/bash'
+
+ (status, output) = self.target.run(cmd)
+ self.assertEqual(0, status, 'Failed to send cmd "{}"'.format(cmd))
+ self.assertEqual(str(output), expected_ret, 'Found "{}", instead of "{}"'.format(output, expected_ret))
diff --git a/meta/lib/oeqa/runtime/connman.py b/meta/lib/oeqa/runtime/connman.py
index cc537f7..70ead4e 100644
--- a/meta/lib/oeqa/runtime/connman.py
+++ b/meta/lib/oeqa/runtime/connman.py
@@ -28,3 +28,43 @@ class ConnmanTest(oeRuntimeTest):
if status != 0:
print self.service_status("connman")
self.fail("No connmand process running")
+
+ @testcase(223)
+ def test_only_one_connmand_in_background(self):
+ """
+ Summary: Only one connmand in background
+ Expected: There will be only one connmand instance in background.
+ Product: BSPs
+ Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ # Make sure that 'connmand' is running in background
+ (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
+ self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
+
+ # Start a new instance of 'connmand'
+ (status, output) = self.target.run('connmand')
+ self.assertEqual(0, status, 'Failed to start a new "connmand" process.')
+
+ # Make sure that only one 'connmand' is running in background
+ (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand | wc -l')
+ self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
+ self.assertEqual(1, int(output), 'Found {} connmand processes running, expected 1.'.format(output))
+
+ @testcase(963)
+ def test_connmand_file(self):
+ """
+ Summary: test connmand file
+ Expected: connman-applet should be ELF32 binary
+ Product: BSPs
+ Author: Lucian Musat <georgex.l.musat@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ cmd = "readelf -h /usr/bin/connman-applet | sed -n '3p' | awk '{print $2}'"
+ expected_ret = 'ELF32'
+
+ (status, output) = self.target.run(cmd)
+ self.assertEqual(0, status, 'Failed to send cmd "{}"'.format(cmd))
+ self.assertEqual(expected_ret, str(output), "Expected {}, found instead {}".format(expected_ret, output))
diff --git a/meta/lib/oeqa/runtime/rpm.py b/meta/lib/oeqa/runtime/rpm.py
index 4ca193b..32aae24 100644
--- a/meta/lib/oeqa/runtime/rpm.py
+++ b/meta/lib/oeqa/runtime/rpm.py
@@ -58,6 +58,43 @@ class RpmInstallRemoveTest(oeRuntimeTest):
(status, output) = self.target.run('sudo -u test1 rpm -qa')
self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa" % status)
+ @testcase(195)
+ @skipUnlessPassed('test_rpm_install')
+ def test_check_rpm_install_removal_log_file_size(self):
+ """
+ Summary: Check rpm install/removal log file size
+ Expected: There should be some method to keep rpm log in a small size .
+ Product: BSPs
+ Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+ db_files_cmd = 'ls /var/lib/rpm/__db.*'
+ get_log_size_cmd = "du /var/lib/rpm/log/log.* | awk '{print $1}'"
+
+ # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
+ (status, output) = self.target.run(db_files_cmd)
+ self.assertEqual(0, status, 'Failed to find database files under /var/lib/rpm/ as __db.xxx')
+
+ # Remove the package just in case
+ self.target.run('rpm -e rpm-doc')
+
+ # Install/Remove a package 10 times
+ for i in range(10):
+ (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+ self.assertEqual(0, status, "Failed to install rpm-doc package. Reason: {}".format(output))
+
+ (status, output) = self.target.run('rpm -e rpm-doc')
+ self.assertEqual(0, status, "Failed to remove rpm-doc package. Reason: {}".format(output))
+
+ # Get the size of log file
+ (status, output) = self.target.run(get_log_size_cmd)
+ self.assertEqual(0, status, 'Failed to get the final size of the log file.')
+
+ # Compare each log size
+ for log_file_size in output:
+ self.assertLessEqual(int(log_file_size), 11264,
+ 'Log file size is greater that expected (~10MB), found {} bytes'.format(log_file_size))
+
@classmethod
def tearDownClass(self):
oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] oeqa/runtime: Added 4 new runtime test cases
2015-07-08 15:17 [PATCH] oeqa/runtime: Added 4 new runtime test cases Daniel Istrate
@ 2015-07-10 22:41 ` Burton, Ross
2015-07-15 7:43 ` ChenQi
1 sibling, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2015-07-10 22:41 UTC (permalink / raw)
To: Daniel Istrate; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
On 8 July 2015 at 16:17, Daniel Istrate <daniel.alexandrux.istrate@intel.com
> wrote:
> + @testcase(963)
> + def test_connmand_file(self):
> + """
> + Summary: test connmand file
> + Expected: connman-applet should be ELF32 binary
> + Product: BSPs
> + Author: Lucian Musat <georgex.l.musat@intel.com>
> + AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
> + """
>
What's the point of this test case? Checking a random binary is a 32-bit
ELF seems a bit strange, especially as it means it will always fail on a
64-bit machine.
Ross
[-- Attachment #2: Type: text/html, Size: 1267 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] oeqa/runtime: Added 4 new runtime test cases
2015-07-08 15:17 [PATCH] oeqa/runtime: Added 4 new runtime test cases Daniel Istrate
2015-07-10 22:41 ` Burton, Ross
@ 2015-07-15 7:43 ` ChenQi
2015-07-15 10:28 ` Burton, Ross
1 sibling, 1 reply; 4+ messages in thread
From: ChenQi @ 2015-07-15 7:43 UTC (permalink / raw)
To: Daniel Istrate, openembedded-core
On 07/08/2015 11:17 PM, Daniel Istrate wrote:
> bash: (240) check bash in image
> connman: (223) Only one connmand in background
> (963) test connmand file
> rpm: (195) Check rpm install/removal log file size
>
> Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
> ---
> meta/lib/oeqa/runtime/bash.py | 23 +++++++++++++++++++++++
> meta/lib/oeqa/runtime/connman.py | 40 ++++++++++++++++++++++++++++++++++++++++
> meta/lib/oeqa/runtime/rpm.py | 37 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 100 insertions(+)
> create mode 100644 meta/lib/oeqa/runtime/bash.py
>
> diff --git a/meta/lib/oeqa/runtime/bash.py b/meta/lib/oeqa/runtime/bash.py
> new file mode 100644
> index 0000000..2a261a3
> --- /dev/null
> +++ b/meta/lib/oeqa/runtime/bash.py
> @@ -0,0 +1,23 @@
> +from oeqa.oetest import oeRuntimeTest
> +from oeqa.utils.decorators import *
> +
> +
> +class BashTest(oeRuntimeTest):
> +
> + @testcase(240)
> + @skipUnlessPassed("test_ssh")
> + def test_check_bash_in_image(self):
> + """
> + Summary: check bash in image
> + Expected: bash command should exist in image
> + Product: BSPs
> + Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
> + AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
> + """
> +
> + cmd = 'which bash'
> + expected_ret = '/bin/bash'
> +
> + (status, output) = self.target.run(cmd)
> + self.assertEqual(0, status, 'Failed to send cmd "{}"'.format(cmd))
> + self.assertEqual(str(output), expected_ret, 'Found "{}", instead of "{}"'.format(output, expected_ret))
> diff --git a/meta/lib/oeqa/runtime/connman.py b/meta/lib/oeqa/runtime/connman.py
> index cc537f7..70ead4e 100644
> --- a/meta/lib/oeqa/runtime/connman.py
> +++ b/meta/lib/oeqa/runtime/connman.py
> @@ -28,3 +28,43 @@ class ConnmanTest(oeRuntimeTest):
> if status != 0:
> print self.service_status("connman")
> self.fail("No connmand process running")
> +
> + @testcase(223)
> + def test_only_one_connmand_in_background(self):
> + """
> + Summary: Only one connmand in background
> + Expected: There will be only one connmand instance in background.
> + Product: BSPs
> + Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
> + AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
> + """
> +
> + # Make sure that 'connmand' is running in background
> + (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
> + self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
> +
> + # Start a new instance of 'connmand'
> + (status, output) = self.target.run('connmand')
> + self.assertEqual(0, status, 'Failed to start a new "connmand" process.')
> +
> + # Make sure that only one 'connmand' is running in background
> + (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand | wc -l')
> + self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
> + self.assertEqual(1, int(output), 'Found {} connmand processes running, expected 1.'.format(output))
> +
> + @testcase(963)
> + def test_connmand_file(self):
> + """
> + Summary: test connmand file
> + Expected: connman-applet should be ELF32 binary
> + Product: BSPs
> + Author: Lucian Musat <georgex.l.musat@intel.com>
> + AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
> + """
> +
> + cmd = "readelf -h /usr/bin/connman-applet | sed -n '3p' | awk '{print $2}'"
> + expected_ret = 'ELF32'
> +
> + (status, output) = self.target.run(cmd)
> + self.assertEqual(0, status, 'Failed to send cmd "{}"'.format(cmd))
> + self.assertEqual(expected_ret, str(output), "Expected {}, found instead {}".format(expected_ret, output))
https://autobuilder.yoctoproject.org/main/builders/nightly-arm64/builds/50/steps/Running%20Sanity%20Tests/logs/stdio
Please look at the above failure.
Regards,
Chen Qi
> diff --git a/meta/lib/oeqa/runtime/rpm.py b/meta/lib/oeqa/runtime/rpm.py
> index 4ca193b..32aae24 100644
> --- a/meta/lib/oeqa/runtime/rpm.py
> +++ b/meta/lib/oeqa/runtime/rpm.py
> @@ -58,6 +58,43 @@ class RpmInstallRemoveTest(oeRuntimeTest):
> (status, output) = self.target.run('sudo -u test1 rpm -qa')
> self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa" % status)
>
> + @testcase(195)
> + @skipUnlessPassed('test_rpm_install')
> + def test_check_rpm_install_removal_log_file_size(self):
> + """
> + Summary: Check rpm install/removal log file size
> + Expected: There should be some method to keep rpm log in a small size .
> + Product: BSPs
> + Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
> + AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
> + """
> + db_files_cmd = 'ls /var/lib/rpm/__db.*'
> + get_log_size_cmd = "du /var/lib/rpm/log/log.* | awk '{print $1}'"
> +
> + # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
> + (status, output) = self.target.run(db_files_cmd)
> + self.assertEqual(0, status, 'Failed to find database files under /var/lib/rpm/ as __db.xxx')
> +
> + # Remove the package just in case
> + self.target.run('rpm -e rpm-doc')
> +
> + # Install/Remove a package 10 times
> + for i in range(10):
> + (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
> + self.assertEqual(0, status, "Failed to install rpm-doc package. Reason: {}".format(output))
> +
> + (status, output) = self.target.run('rpm -e rpm-doc')
> + self.assertEqual(0, status, "Failed to remove rpm-doc package. Reason: {}".format(output))
> +
> + # Get the size of log file
> + (status, output) = self.target.run(get_log_size_cmd)
> + self.assertEqual(0, status, 'Failed to get the final size of the log file.')
> +
> + # Compare each log size
> + for log_file_size in output:
> + self.assertLessEqual(int(log_file_size), 11264,
> + 'Log file size is greater that expected (~10MB), found {} bytes'.format(log_file_size))
> +
> @classmethod
> def tearDownClass(self):
> oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] oeqa/runtime: Added 4 new runtime test cases
2015-07-15 7:43 ` ChenQi
@ 2015-07-15 10:28 ` Burton, Ross
0 siblings, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2015-07-15 10:28 UTC (permalink / raw)
To: ChenQi; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
On 15 July 2015 at 08:43, ChenQi <Qi.Chen@windriver.com> wrote:
>
> https://autobuilder.yoctoproject.org/main/builders/nightly-arm64/builds/50/steps/Running%20Sanity%20Tests/logs/stdio
>
> Please look at the above failure.
>
Literally no idea why I ended up merging this into mut, because I knew it
would fail.
I've just removed it. Daniel, can you please re-submit without the connman
test (and get that connman test removed from the test cases).
Ross
[-- Attachment #2: Type: text/html, Size: 1055 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-15 10:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 15:17 [PATCH] oeqa/runtime: Added 4 new runtime test cases Daniel Istrate
2015-07-10 22:41 ` Burton, Ross
2015-07-15 7:43 ` ChenQi
2015-07-15 10:28 ` Burton, Ross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox