All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] miscellaneous patches
@ 2014-04-01  9:09 Kai Kang
  2014-04-01  9:09 ` [PATCH 1/3] xorg: Fix for CVE-2013-6424 Kai Kang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kai Kang @ 2014-04-01  9:09 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit dee07bee84361eb58cdc0e267b22d71155b89b65:

  beaglebone: fix typo in the U-Boot config name (2014-03-31 23:04:36 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib kangkai/misc
  http://git.yoctoproject.org/cgit.cgi//log/?h=kangkai/misc

Kai Kang (1):
  xorg: Fix for CVE-2013-6424

Li Wang (1):
  cmake: follow ptest output format

yanjun.zhu (1):
  util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x

 meta/recipes-core/util-linux/util-linux.inc        |   6 ++
 meta/recipes-devtools/cmake/cmake.inc              |   1 +
 .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
 .../xserver-xorg/xorg-CVE-2013-6424.patch          |  31 ++++++
 .../xorg-xserver/xserver-xorg_1.15.0.bb            |   1 +
 5 files changed, 157 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch

-- 
1.8.1.2



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] xorg: Fix for CVE-2013-6424
  2014-04-01  9:09 [PATCH 0/3] miscellaneous patches Kai Kang
@ 2014-04-01  9:09 ` Kai Kang
  2014-04-01  9:09 ` [PATCH 2/3] cmake: follow ptest output format Kai Kang
  2014-04-01  9:09 ` [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x Kai Kang
  2 siblings, 0 replies; 8+ messages in thread
From: Kai Kang @ 2014-04-01  9:09 UTC (permalink / raw)
  To: openembedded-core

Integer underflow in the xTrapezoidValid macro in render/picture.h in X.Org
allows context-dependent attackers to cause a denial of service (crash) via
a negative bottom value.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-6424

Signed-off-by: Baogen Shang <baogen.shang@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../xserver-xorg/xorg-CVE-2013-6424.patch          | 31 ++++++++++++++++++++++
 .../xorg-xserver/xserver-xorg_1.15.0.bb            |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch

diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch
new file mode 100644
index 0000000..7c61530
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/xorg-CVE-2013-6424.patch
@@ -0,0 +1,31 @@
+This patch comes from:
+http://lists.x.org/archives/xorg-devel/2013-October/037996.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Baogen shang <baogen.shang@windriver.com>
+diff -Naur xorg-server-1.14.0-orig/exa/exa_render.c xorg-server-1.14.0/exa/exa_render.c
+--- xorg-server-1.14.0-orig/exa/exa_render.c	2014-02-27 14:32:38.000000000 +0800
++++ xorg-server-1.14.0/exa/exa_render.c	2014-02-27 15:46:59.000000000 +0800
+@@ -1141,7 +1141,8 @@
+ 
+         exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
+         for (; ntrap; ntrap--, traps++)
+-            (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
++            if (xTrapezoidValid(traps))
++                (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1);
+         exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
+ 
+         xRel = bounds.x1 + xSrc - xDst;
+diff -Naur xorg-server-1.14.0-orig/render/picture.h xorg-server-1.14.0/render/picture.h
+--- xorg-server-1.14.0-orig/render/picture.h	2014-02-27 14:32:26.000000000 +0800
++++ xorg-server-1.14.0/render/picture.h	2014-02-27 15:48:13.000000000 +0800
+@@ -211,7 +211,7 @@
+ /* whether 't' is a well defined not obviously empty trapezoid */
+ #define xTrapezoidValid(t)  ((t)->left.p1.y != (t)->left.p2.y && \
+ 			     (t)->right.p1.y != (t)->right.p2.y && \
+-			     (int) ((t)->bottom - (t)->top) > 0)
++			     ((t)->bottom > (t)->top))
+ 
+ /*
+  * Standard NTSC luminance conversions:
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.15.0.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.15.0.bb
index a4dda4e..1f9fa04 100644
--- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.15.0.bb
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.15.0.bb
@@ -5,6 +5,7 @@ SRC_URI += "file://crosscompile.patch \
             file://fix_open_max_preprocessor_error.patch \
             file://mips64-compiler.patch \
             file://aarch64.patch \
+            file://xorg-CVE-2013-6424.patch \
            "
 
 SRC_URI[md5sum] = "c2ace3697b32414094cf8c597c39d7d9"
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] cmake: follow ptest output format
  2014-04-01  9:09 [PATCH 0/3] miscellaneous patches Kai Kang
  2014-04-01  9:09 ` [PATCH 1/3] xorg: Fix for CVE-2013-6424 Kai Kang
@ 2014-04-01  9:09 ` Kai Kang
  2014-04-01 10:49   ` Richard Purdie
  2014-04-01  9:09 ` [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x Kai Kang
  2 siblings, 1 reply; 8+ messages in thread
From: Kai Kang @ 2014-04-01  9:09 UTC (permalink / raw)
  To: openembedded-core

From: Li Wang <li.wang@windriver.com>

ptest output format is incorrect, according to yocto Development Manual
(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)

The test generates output in the format used by Automake:
<result>: <testname>
where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.

So we should change the test result format to match yocto ptest rules.

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-devtools/cmake/cmake.inc              |   1 +
 .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
 2 files changed, 119 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch

diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
index 1d5303f..254af45 100644
--- a/meta/recipes-devtools/cmake/cmake.inc
+++ b/meta/recipes-devtools/cmake/cmake.inc
@@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
            file://aarch64-kwsys.patch \
            file://qt4-fail-silent.patch \
            file://cmake-2.8.11.2-FindFreetype.patch \
+           file://follow_ptest_output_format.patch \
            "
 
 inherit autotools-brokensep
diff --git a/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
new file mode 100644
index 0000000..5428df2
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
@@ -0,0 +1,118 @@
+cmake: follow ptest output format
+
+ptest output format is incorrect, according to yocto Development Manual
+(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
+5.10.6. Testing Packages With ptest
+The test generates output in the format used by Automake:
+<result>: <testname>
+where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
+So we should change the test result format to match yocto ptest rules.
+
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+--- a/Source/CTest/cmCTestRunTest.cxx
++++ b/Source/CTest/cmCTestRunTest.cxx
+@@ -145,8 +145,8 @@
+     this->CompressOutput();
+     }
+ 
+-  this->WriteLogOutputTop(completed, total);
+   std::string reason;
++  std::string result;
+   bool passed = true;
+   int res = started ? this->TestProcess->GetProcessStatus()
+                     : cmsysProcess_State_Error;
+@@ -208,57 +208,58 @@
+       || (!success && this->TestProperties->WillFail))
+       {
+       this->TestResult.Status = cmCTestTestHandler::COMPLETED;
+-      cmCTestLog(this->CTest, HANDLER_OUTPUT, "   Passed  " );
++      result = "           ";
+       }
+     else
+       {
+       this->TestResult.Status = cmCTestTestHandler::FAILED;
+-      cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed  " << reason );
++      result = "           " + reason;
+       outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
+       }
+     }
+   else if ( res == cmsysProcess_State_Expired )
+     {
+-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout ");
++    result = "***Timeout ";
+     this->TestResult.Status = cmCTestTestHandler::TIMEOUT;
+     outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
+     }
+   else if ( res == cmsysProcess_State_Exception )
+     {
+     outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
+-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: ");
++    result = "***Exception: ";
+     switch(this->TestProcess->GetExitException())
+       {
+       case cmsysProcess_Exception_Fault:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault");
++        result += "SegFault";
+         this->TestResult.Status = cmCTestTestHandler::SEGFAULT;
+         break;
+       case cmsysProcess_Exception_Illegal:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Illegal");
++        result += "Illegal";
+         this->TestResult.Status = cmCTestTestHandler::ILLEGAL;
+         break;
+       case cmsysProcess_Exception_Interrupt:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Interrupt");
++        result += "Interrupt";
+         this->TestResult.Status = cmCTestTestHandler::INTERRUPT;
+         break;
+       case cmsysProcess_Exception_Numerical:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Numerical");
++        result += "Numerical";
+         this->TestResult.Status = cmCTestTestHandler::NUMERICAL;
+         break;
+       default:
+-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other");
++        result += "Other";
+         this->TestResult.Status = cmCTestTestHandler::OTHER_FAULT;
+       }
+     }
+   else //cmsysProcess_State_Error
+     {
+-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Not Run ");
++    result = "***Not Run ";
+     }
+ 
+   passed = this->TestResult.Status == cmCTestTestHandler::COMPLETED;
+   char buf[1024];
+   sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime());
+-  cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n" );
++  this->WriteLogOutputTop(completed, total);
++  cmCTestLog(this->CTest, HANDLER_OUTPUT, result << buf << "\n" );
+ 
+   if ( outputTestErrorsToConsole )
+     {
+@@ -398,6 +399,7 @@
+ // Starts the execution of a test.  Returns once it has started
+ bool cmCTestRunTest::StartTest(size_t total)
+ {
++  cmCTestLog(this->CTest, HANDLER_OUTPUT, "      ");
+   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(2*getNumWidth(total) + 8)
+     << "Start "
+     << std::setw(getNumWidth(this->TestHandler->GetMaxIndex()))
+@@ -679,6 +681,15 @@
+ 
+ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
+ {
++  if ( this->TestResult.Status == cmCTestTestHandler::COMPLETED )
++    {
++    cmCTestLog(this->CTest, HANDLER_OUTPUT, "PASS: " );
++    }
++  else
++    {
++    cmCTestLog(this->CTest, HANDLER_OUTPUT, "FAIL: " );
++    }
++
+   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total))
+              << completed << "/");
+   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total))
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x
  2014-04-01  9:09 [PATCH 0/3] miscellaneous patches Kai Kang
  2014-04-01  9:09 ` [PATCH 1/3] xorg: Fix for CVE-2013-6424 Kai Kang
  2014-04-01  9:09 ` [PATCH 2/3] cmake: follow ptest output format Kai Kang
@ 2014-04-01  9:09 ` Kai Kang
  2014-04-01 10:15   ` Richard Purdie
  2 siblings, 1 reply; 8+ messages in thread
From: Kai Kang @ 2014-04-01  9:09 UTC (permalink / raw)
  To: openembedded-core

From: "yanjun.zhu" <yanjun.zhu@windriver.com>

__NR_setns is not defined in linux kernel 2.6.x. To linux kernel 3.0,
this variable is defined. It has been shown that no native tools use
this syscall, so it is safe to make this substitution

Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index ad7aac7..0f065b4 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -112,6 +112,12 @@ RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linu
 SYSTEMD_PACKAGES = "${PN}-uuidd"
 SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service"
 
+do_compile_prepend_class-native() {
+	if [ `uname -r | grep "2.6."` ]; then
+		sed -i 's:return syscall(SYS_setns:fprintf(stderr,"Kernel does not support setns");\n\treturn 1;\n//return syscall(:g' ${S}/include/namespace.h
+	fi
+}
+
 do_compile () {
 	set -e
 	install ${WORKDIR}/MCONFIG ${S}/MCONFIG
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x
  2014-04-01  9:09 ` [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x Kai Kang
@ 2014-04-01 10:15   ` Richard Purdie
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2014-04-01 10:15 UTC (permalink / raw)
  To: Kai Kang; +Cc: openembedded-core

On Tue, 2014-04-01 at 17:09 +0800, Kai Kang wrote:
> From: "yanjun.zhu" <yanjun.zhu@windriver.com>
> 
> __NR_setns is not defined in linux kernel 2.6.x. To linux kernel 3.0,
> this variable is defined. It has been shown that no native tools use
> this syscall, so it is safe to make this substitution
> 
> Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta/recipes-core/util-linux/util-linux.inc | 6 ++++++
>  1 file changed, 6 insertions(+)

This is horrible. Firstly "no native tools use this syscall" - how did
you check that? I suspect you perhaps mean "no native tools in OE-Core
at this time"? How would we know when one is added?

Secondly, this should not be done as a sed, it should be a patch with a
description. This means when we upgrade util-linux, it doesn't silently
stop working or do something unintended.

Cheers,

Richard

> diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
> index ad7aac7..0f065b4 100644
> --- a/meta/recipes-core/util-linux/util-linux.inc
> +++ b/meta/recipes-core/util-linux/util-linux.inc
> @@ -112,6 +112,12 @@ RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linu
>  SYSTEMD_PACKAGES = "${PN}-uuidd"
>  SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service"
>  
> +do_compile_prepend_class-native() {
> +	if [ `uname -r | grep "2.6."` ]; then
> +		sed -i 's:return syscall(SYS_setns:fprintf(stderr,"Kernel does not support setns");\n\treturn 1;\n//return syscall(:g' ${S}/include/namespace.h
> +	fi
> +}
> +
>  do_compile () {
>  	set -e
>  	install ${WORKDIR}/MCONFIG ${S}/MCONFIG
> -- 
> 1.8.1.2
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] cmake: follow ptest output format
  2014-04-01  9:09 ` [PATCH 2/3] cmake: follow ptest output format Kai Kang
@ 2014-04-01 10:49   ` Richard Purdie
  2014-04-01 22:33     ` Otavio Salvador
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2014-04-01 10:49 UTC (permalink / raw)
  To: Kai Kang; +Cc: openembedded-core

On Tue, 2014-04-01 at 17:09 +0800, Kai Kang wrote:
> From: Li Wang <li.wang@windriver.com>
> 
> ptest output format is incorrect, according to yocto Development Manual
> (http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
> 
> The test generates output in the format used by Automake:
> <result>: <testname>
> where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
> 
> So we should change the test result format to match yocto ptest rules.
> 
> Signed-off-by: Li Wang <li.wang@windriver.com>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta/recipes-devtools/cmake/cmake.inc              |   1 +
>  .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
>  2 files changed, 119 insertions(+)
>  create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
> 
> diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
> index 1d5303f..254af45 100644
> --- a/meta/recipes-devtools/cmake/cmake.inc
> +++ b/meta/recipes-devtools/cmake/cmake.inc
> @@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
>             file://aarch64-kwsys.patch \
>             file://qt4-fail-silent.patch \
>             file://cmake-2.8.11.2-FindFreetype.patch \
> +           file://follow_ptest_output_format.patch \
>             "
>  
>  inherit autotools-brokensep
> diff --git a/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
> new file mode 100644
> index 0000000..5428df2
> --- /dev/null
> +++ b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
> @@ -0,0 +1,118 @@
> +cmake: follow ptest output format
> +
> +ptest output format is incorrect, according to yocto Development Manual
> +(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
> +5.10.6. Testing Packages With ptest
> +The test generates output in the format used by Automake:
> +<result>: <testname>
> +where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
> +So we should change the test result format to match yocto ptest rules.
> +
> +Signed-off-by: Li Wang <li.wang@windriver.com>

No upstream status. Is there any chance of this going upstream? Might we
be better off postprocessing the output with a script to put it into the
right format?

Cheers,

Richard


> +---
> +--- a/Source/CTest/cmCTestRunTest.cxx
> ++++ b/Source/CTest/cmCTestRunTest.cxx
> +@@ -145,8 +145,8 @@
> +     this->CompressOutput();
> +     }
> + 
> +-  this->WriteLogOutputTop(completed, total);
> +   std::string reason;
> ++  std::string result;
> +   bool passed = true;
> +   int res = started ? this->TestProcess->GetProcessStatus()
> +                     : cmsysProcess_State_Error;
> +@@ -208,57 +208,58 @@
> +       || (!success && this->TestProperties->WillFail))
> +       {
> +       this->TestResult.Status = cmCTestTestHandler::COMPLETED;
> +-      cmCTestLog(this->CTest, HANDLER_OUTPUT, "   Passed  " );
> ++      result = "           ";
> +       }
> +     else
> +       {
> +       this->TestResult.Status = cmCTestTestHandler::FAILED;
> +-      cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Failed  " << reason );
> ++      result = "           " + reason;
> +       outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
> +       }
> +     }
> +   else if ( res == cmsysProcess_State_Expired )
> +     {
> +-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Timeout ");
> ++    result = "***Timeout ";
> +     this->TestResult.Status = cmCTestTestHandler::TIMEOUT;
> +     outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
> +     }
> +   else if ( res == cmsysProcess_State_Exception )
> +     {
> +     outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
> +-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: ");
> ++    result = "***Exception: ";
> +     switch(this->TestProcess->GetExitException())
> +       {
> +       case cmsysProcess_Exception_Fault:
> +-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault");
> ++        result += "SegFault";
> +         this->TestResult.Status = cmCTestTestHandler::SEGFAULT;
> +         break;
> +       case cmsysProcess_Exception_Illegal:
> +-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Illegal");
> ++        result += "Illegal";
> +         this->TestResult.Status = cmCTestTestHandler::ILLEGAL;
> +         break;
> +       case cmsysProcess_Exception_Interrupt:
> +-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Interrupt");
> ++        result += "Interrupt";
> +         this->TestResult.Status = cmCTestTestHandler::INTERRUPT;
> +         break;
> +       case cmsysProcess_Exception_Numerical:
> +-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Numerical");
> ++        result += "Numerical";
> +         this->TestResult.Status = cmCTestTestHandler::NUMERICAL;
> +         break;
> +       default:
> +-        cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other");
> ++        result += "Other";
> +         this->TestResult.Status = cmCTestTestHandler::OTHER_FAULT;
> +       }
> +     }
> +   else //cmsysProcess_State_Error
> +     {
> +-    cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Not Run ");
> ++    result = "***Not Run ";
> +     }
> + 
> +   passed = this->TestResult.Status == cmCTestTestHandler::COMPLETED;
> +   char buf[1024];
> +   sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime());
> +-  cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n" );
> ++  this->WriteLogOutputTop(completed, total);
> ++  cmCTestLog(this->CTest, HANDLER_OUTPUT, result << buf << "\n" );
> + 
> +   if ( outputTestErrorsToConsole )
> +     {
> +@@ -398,6 +399,7 @@
> + // Starts the execution of a test.  Returns once it has started
> + bool cmCTestRunTest::StartTest(size_t total)
> + {
> ++  cmCTestLog(this->CTest, HANDLER_OUTPUT, "      ");
> +   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(2*getNumWidth(total) + 8)
> +     << "Start "
> +     << std::setw(getNumWidth(this->TestHandler->GetMaxIndex()))
> +@@ -679,6 +681,15 @@
> + 
> + void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
> + {
> ++  if ( this->TestResult.Status == cmCTestTestHandler::COMPLETED )
> ++    {
> ++    cmCTestLog(this->CTest, HANDLER_OUTPUT, "PASS: " );
> ++    }
> ++  else
> ++    {
> ++    cmCTestLog(this->CTest, HANDLER_OUTPUT, "FAIL: " );
> ++    }
> ++
> +   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total))
> +              << completed << "/");
> +   cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(getNumWidth(total))
> -- 
> 1.8.1.2
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] cmake: follow ptest output format
  2014-04-01 10:49   ` Richard Purdie
@ 2014-04-01 22:33     ` Otavio Salvador
  2014-04-02  1:24       ` Kang Kai
  0 siblings, 1 reply; 8+ messages in thread
From: Otavio Salvador @ 2014-04-01 22:33 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

Hello,

On Tue, Apr 1, 2014 at 7:49 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2014-04-01 at 17:09 +0800, Kai Kang wrote:
>> From: Li Wang <li.wang@windriver.com>
>>
>> ptest output format is incorrect, according to yocto Development Manual
>> (http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
>>
>> The test generates output in the format used by Automake:
>> <result>: <testname>
>> where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
>>
>> So we should change the test result format to match yocto ptest rules.
>>
>> Signed-off-by: Li Wang <li.wang@windriver.com>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> ---
>>  meta/recipes-devtools/cmake/cmake.inc              |   1 +
>>  .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
>>  2 files changed, 119 insertions(+)
>>  create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
>>
>> diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
>> index 1d5303f..254af45 100644
>> --- a/meta/recipes-devtools/cmake/cmake.inc
>> +++ b/meta/recipes-devtools/cmake/cmake.inc
>> @@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
>>             file://aarch64-kwsys.patch \
>>             file://qt4-fail-silent.patch \
>>             file://cmake-2.8.11.2-FindFreetype.patch \
>> +           file://follow_ptest_output_format.patch \
>>             "
>>
>>  inherit autotools-brokensep
>> diff --git a/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
>> new file mode 100644
>> index 0000000..5428df2
>> --- /dev/null
>> +++ b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
>> @@ -0,0 +1,118 @@
>> +cmake: follow ptest output format
>> +
>> +ptest output format is incorrect, according to yocto Development Manual
>> +(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
>> +5.10.6. Testing Packages With ptest
>> +The test generates output in the format used by Automake:
>> +<result>: <testname>
>> +where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
>> +So we should change the test result format to match yocto ptest rules.
>> +
>> +Signed-off-by: Li Wang <li.wang@windriver.com>
>
> No upstream status. Is there any chance of this going upstream? Might we
> be better off postprocessing the output with a script to put it into the
> right format?

I agree with both remarks. It'd be good to try to get it somehow
integrated upstream and for OE-Core interim solution would be better
to 'convert' using an external script. This may break external tests
tools people may be using as it changes the format without allowing to
'revert' for normal format.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] cmake: follow ptest output format
  2014-04-01 22:33     ` Otavio Salvador
@ 2014-04-02  1:24       ` Kang Kai
  0 siblings, 0 replies; 8+ messages in thread
From: Kang Kai @ 2014-04-02  1:24 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3299 bytes --]

On 2014?04?02? 06:33, Otavio Salvador wrote:
> Hello,
>
> On Tue, Apr 1, 2014 at 7:49 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>> On Tue, 2014-04-01 at 17:09 +0800, Kai Kang wrote:
>>> From: Li Wang <li.wang@windriver.com>
>>>
>>> ptest output format is incorrect, according to yocto Development Manual
>>> (http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
>>>
>>> The test generates output in the format used by Automake:
>>> <result>: <testname>
>>> where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
>>>
>>> So we should change the test result format to match yocto ptest rules.
>>>
>>> Signed-off-by: Li Wang <li.wang@windriver.com>
>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>> ---
>>>   meta/recipes-devtools/cmake/cmake.inc              |   1 +
>>>   .../cmake/cmake/follow_ptest_output_format.patch   | 118 +++++++++++++++++++++
>>>   2 files changed, 119 insertions(+)
>>>   create mode 100644 meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
>>>
>>> diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
>>> index 1d5303f..254af45 100644
>>> --- a/meta/recipes-devtools/cmake/cmake.inc
>>> +++ b/meta/recipes-devtools/cmake/cmake.inc
>>> @@ -17,6 +17,7 @@ SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz
>>>              file://aarch64-kwsys.patch \
>>>              file://qt4-fail-silent.patch \
>>>              file://cmake-2.8.11.2-FindFreetype.patch \
>>> +           file://follow_ptest_output_format.patch \
>>>              "
>>>
>>>   inherit autotools-brokensep
>>> diff --git a/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
>>> new file mode 100644
>>> index 0000000..5428df2
>>> --- /dev/null
>>> +++ b/meta/recipes-devtools/cmake/cmake/follow_ptest_output_format.patch
>>> @@ -0,0 +1,118 @@
>>> +cmake: follow ptest output format
>>> +
>>> +ptest output format is incorrect, according to yocto Development Manual
>>> +(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
>>> +5.10.6. Testing Packages With ptest
>>> +The test generates output in the format used by Automake:
>>> +<result>: <testname>
>>> +where the result can be PASS, FAIL, or SKIP, and the testname can be any identifying string.
>>> +So we should change the test result format to match yocto ptest rules.
>>> +
>>> +Signed-off-by: Li Wang <li.wang@windriver.com>
>> No upstream status. Is there any chance of this going upstream? Might we
>> be better off postprocessing the output with a script to put it into the
>> right format?
> I agree with both remarks. It'd be good to try to get it somehow
> integrated upstream and for OE-Core interim solution would be better
> to 'convert' using an external script. This may break external tests
> tools people may be using as it changes the format without allowing to
> 'revert' for normal format.
>

OK. I'll send it upstream and see what's going on.

-- 
Regards,
Neil | Kai Kang


[-- Attachment #2: Type: text/html, Size: 4881 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-02  1:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-01  9:09 [PATCH 0/3] miscellaneous patches Kai Kang
2014-04-01  9:09 ` [PATCH 1/3] xorg: Fix for CVE-2013-6424 Kai Kang
2014-04-01  9:09 ` [PATCH 2/3] cmake: follow ptest output format Kai Kang
2014-04-01 10:49   ` Richard Purdie
2014-04-01 22:33     ` Otavio Salvador
2014-04-02  1:24       ` Kang Kai
2014-04-01  9:09 ` [PATCH 3/3] util-linux-native: Remove SYS_setns system call in linux kernel 2.6.x Kai Kang
2014-04-01 10:15   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.