opencompute-developers team mailing list archive
-
opencompute-developers team
-
Mailing list archive
-
Message #00233
[Merge] lp:~sophia-wu/opencompute/add-ocp-system-log-job into lp:opencompute/checkbox
Sophia Wu has proposed merging lp:~sophia-wu/opencompute/add-ocp-system-log-job into lp:opencompute/checkbox.
Requested reviews:
Jeff Lane (bladernr)
For more details, see:
https://code.launchpad.net/~sophia-wu/opencompute/add-ocp-system-log-job/+merge/205957
Add OCP system Log job and it contains the test case that can verify system log entries number > 256.
--
https://code.launchpad.net/~sophia-wu/opencompute/add-ocp-system-log-job/+merge/205957
Your team Open Compute Developers is subscribed to branch lp:opencompute/checkbox.
=== added file 'data/whitelists/opencompute-certify-local.whitelist'
--- data/whitelists/opencompute-certify-local.whitelist 1970-01-01 00:00:00 +0000
+++ data/whitelists/opencompute-certify-local.whitelist 2014-02-12 13:18:04 +0000
@@ -0,0 +1,48 @@
+## This whitelist is intended for use inside Canonical's test labs. The tests
+## conained in this list are the same as those contained in the
+## server-selftest.whitelist file that OEMs may use. The difference here is that
+## some of these tests depend on a specific network environment and may not run
+## properly in your test environment. To avoid false failures, please use the
+## server-selftest.whitelist instead.
+# Resource Jobs
+block_device
+cdimage
+cpuinfo
+device
+dmi
+dpkg
+efi
+environment
+gconf
+lsb
+meminfo
+module
+optical_drive
+package
+sleep
+uname
+#Info attachment jobs
+__info__
+cpuinfo_attachment
+dmesg_attachment
+dmi_attachment
+dmidecode_attachment
+efi_attachment
+lspci_attachment
+lshw_attachment
+mcelog_attachment
+meminfo_attachment
+modprobe_attachment
+modules_attachment
+sysctl_attachment
+sysfs_attachment
+udev_attachment
+lsmod_attachment
+acpi_sleep_attachment
+info/hdparm
+info/hdparm_.*.txt
+installer_debug.gz
+info/disk_partitions
+# Actual test cases
+__TC-002-0011-System_Log__
+TC-002-0011-001-System_Log_Entries
=== renamed file 'data/whitelists/opencompute-certify-local.whitelist' => 'data/whitelists/opencompute-certify-local.whitelist.moved'
=== added file 'jobs/TC-002-0011-System_Log.txt.in'
--- jobs/TC-002-0011-System_Log.txt.in 1970-01-01 00:00:00 +0000
+++ jobs/TC-002-0011-System_Log.txt.in 2014-02-12 13:18:04 +0000
@@ -0,0 +1,7 @@
+plugin: shell
+name: TC-002-0011-001-System_Log_Entries
+requires: package.name == 'dcmitool'
+user: root
+command: dcmi_sel_entries
+description: 1.dcmitool 2.Calculate entries number of system event log 3.A log capable of at least 256 entries
+
=== modified file 'jobs/local.txt.in'
--- jobs/local.txt.in 2014-02-11 12:16:41 +0000
+++ jobs/local.txt.in 2014-02-12 13:18:04 +0000
@@ -109,6 +109,7 @@
command:
shopt -s extglob
cat $CHECKBOX_SHARE/jobs/sniff.txt?(.in)
+<<<<<<< TREE
name: __TC-001-0002-Platform_Controller_Hub__
plugin: local
@@ -116,3 +117,13 @@
command:
shopt -s extglob
cat $CHECKBOX_SHARE/jobs/TC-001-0002-Platform_Controller_Hub.txt?(.in)
+=======
+
+name: __TC-002-0011-System_Log__
+plugin: local
+description: System Event Log
+command:
+ shopt -s extglob
+ cat $CHECKBOX_SHARE/jobs/TC-002-0011-System_Log.txt?(.in)
+
+>>>>>>> MERGE-SOURCE
=== added file 'scripts/dcmi_sel_entries'
--- scripts/dcmi_sel_entries 1970-01-01 00:00:00 +0000
+++ scripts/dcmi_sel_entries 2014-02-12 13:18:04 +0000
@@ -0,0 +1,72 @@
+#!/usr/bin/env python3
+"""
+Copyright (C) 2010-2013 by Cloud Computing Center for Mobile Applications
+Industrial Technology Research Institute
+
+File Name
+ dcmi_sel_entries
+
+Authors
+ Sophia Wu <Sophia.Wu@xxxxxxxxxxx>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 3,
+as published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+"""
+import sys
+import shlex
+import re
+import subprocess
+from subprocess import (
+ CalledProcessError,
+ check_call,
+ check_output
+)
+
+#Retrieve entries number that already used
+def get_entry_used(output):
+ entry_used = re.search(r'Entries\D*(\d+)', output)
+ return entry_used.group(1)
+
+#Retrieve percentage of entries space which already used
+def get_entry_per(output):
+ entry_per = re.search(r'Percent Used\D*(\d+)', output)
+ return entry_per.group(1)
+
+def main():
+ cmd = "dcmitool sel"
+
+ try:
+ dcmi_sel_return = check_output(shlex.split(cmd),
+ stderr=subprocess.STDOUT, universal_newlines=True)
+ except CalledProcessError as command_exception:
+ print("Failed executing dcmi command, Reason:%s." %(command_exception))
+ sys.exit(1)
+
+ #Cauculate total entries number
+ try:
+ entry_space = int(get_entry_used(dcmi_sel_return))\
+ /int(get_entry_per(dcmi_sel_return))*100
+ except ArithmeticError:
+ print("Arithmetic Error")
+ sys.exit(2)
+
+ if entry_space < 256:
+ print("Entries Number:", int(entry_space), "Entries Number is too least.")
+ sys.exit(3)
+
+ print("Entries Number:%d. Entries Number is more than 256." %(entry_space))
+ sys.exit(0)
+
+if __name__ == "__main__":
+ main()
+