diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/bblogging.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bblogging.py b/meta/lib/oeqa/selftest/cases/bblogging.py index 6b0bbfe1c1..317e68b82f 100644 --- a/meta/lib/oeqa/selftest/cases/bblogging.py +++ b/meta/lib/oeqa/selftest/cases/bblogging.py | |||
| @@ -11,7 +11,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 11 | def assertCount(self, item, entry, count): | 11 | def assertCount(self, item, entry, count): |
| 12 | self.assertEqual(item.count(entry), count, msg="Output:\n'''\n%s\n'''\ndoesn't contain %d copies of:\n'''\n%s\n'''\n" % (item, count, entry)) | 12 | self.assertEqual(item.count(entry), count, msg="Output:\n'''\n%s\n'''\ndoesn't contain %d copies of:\n'''\n%s\n'''\n" % (item, count, entry)) |
| 13 | 13 | ||
| 14 | def test_shell_logging(self): | 14 | def test_shell_loggingA(self): |
| 15 | # no logs, no verbose | 15 | # no logs, no verbose |
| 16 | self.write_config('BBINCLUDELOGS = ""') | 16 | self.write_config('BBINCLUDELOGS = ""') |
| 17 | result = bitbake("logging-test -c shelltest -f", ignore_status = True) | 17 | result = bitbake("logging-test -c shelltest -f", ignore_status = True) |
| @@ -19,6 +19,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 19 | self.assertNotIn("This is shell stdout", result.output) | 19 | self.assertNotIn("This is shell stdout", result.output) |
| 20 | self.assertNotIn("This is shell stderr", result.output) | 20 | self.assertNotIn("This is shell stderr", result.output) |
| 21 | 21 | ||
| 22 | def test_shell_loggingB(self): | ||
| 22 | # logs, no verbose | 23 | # logs, no verbose |
| 23 | self.write_config('BBINCLUDELOGS = "yes"') | 24 | self.write_config('BBINCLUDELOGS = "yes"') |
| 24 | result = bitbake("logging-test -c shelltest -f", ignore_status = True) | 25 | result = bitbake("logging-test -c shelltest -f", ignore_status = True) |
| @@ -26,6 +27,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 26 | self.assertCount(result.output, "This is shell stdout", 1) | 27 | self.assertCount(result.output, "This is shell stdout", 1) |
| 27 | self.assertCount(result.output, "This is shell stderr", 1) | 28 | self.assertCount(result.output, "This is shell stderr", 1) |
| 28 | 29 | ||
| 30 | def test_shell_loggingC(self): | ||
| 29 | # no logs, verbose | 31 | # no logs, verbose |
| 30 | self.write_config('BBINCLUDELOGS = ""') | 32 | self.write_config('BBINCLUDELOGS = ""') |
| 31 | result = bitbake("logging-test -c shelltest -f -v", ignore_status = True) | 33 | result = bitbake("logging-test -c shelltest -f -v", ignore_status = True) |
| @@ -34,6 +36,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 34 | self.assertCount(result.output, "This is shell stdout", 2) | 36 | self.assertCount(result.output, "This is shell stdout", 2) |
| 35 | self.assertCount(result.output, "This is shell stderr", 2) | 37 | self.assertCount(result.output, "This is shell stderr", 2) |
| 36 | 38 | ||
| 39 | def test_shell_loggingD(self): | ||
| 37 | # logs, verbose | 40 | # logs, verbose |
| 38 | self.write_config('BBINCLUDELOGS = "yes"') | 41 | self.write_config('BBINCLUDELOGS = "yes"') |
| 39 | result = bitbake("logging-test -c shelltest -f -v", ignore_status = True) | 42 | result = bitbake("logging-test -c shelltest -f -v", ignore_status = True) |
| @@ -42,7 +45,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 42 | self.assertCount(result.output, "This is shell stdout", 2) | 45 | self.assertCount(result.output, "This is shell stdout", 2) |
| 43 | self.assertCount(result.output, "This is shell stderr", 2) | 46 | self.assertCount(result.output, "This is shell stderr", 2) |
| 44 | 47 | ||
| 45 | def test_python_exec_func_shell_logging(self): | 48 | def test_python_exec_func_shell_loggingA(self): |
| 46 | # no logs, no verbose | 49 | # no logs, no verbose |
| 47 | self.write_config('BBINCLUDELOGS = ""') | 50 | self.write_config('BBINCLUDELOGS = ""') |
| 48 | result = bitbake("logging-test -c pythontest_exec_func_shell -f", | 51 | result = bitbake("logging-test -c pythontest_exec_func_shell -f", |
| @@ -51,6 +54,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 51 | self.assertNotIn("This is shell stdout", result.output) | 54 | self.assertNotIn("This is shell stdout", result.output) |
| 52 | self.assertNotIn("This is shell stderr", result.output) | 55 | self.assertNotIn("This is shell stderr", result.output) |
| 53 | 56 | ||
| 57 | def test_python_exec_func_shell_loggingB(self): | ||
| 54 | # logs, no verbose | 58 | # logs, no verbose |
| 55 | self.write_config('BBINCLUDELOGS = "yes"') | 59 | self.write_config('BBINCLUDELOGS = "yes"') |
| 56 | result = bitbake("logging-test -c pythontest_exec_func_shell -f", | 60 | result = bitbake("logging-test -c pythontest_exec_func_shell -f", |
| @@ -59,6 +63,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 59 | self.assertCount(result.output, "This is shell stdout", 1) | 63 | self.assertCount(result.output, "This is shell stdout", 1) |
| 60 | self.assertCount(result.output, "This is shell stderr", 1) | 64 | self.assertCount(result.output, "This is shell stderr", 1) |
| 61 | 65 | ||
| 66 | def test_python_exec_func_shell_loggingC(self): | ||
| 62 | # no logs, verbose | 67 | # no logs, verbose |
| 63 | self.write_config('BBINCLUDELOGS = ""') | 68 | self.write_config('BBINCLUDELOGS = ""') |
| 64 | result = bitbake("logging-test -c pythontest_exec_func_shell -f -v", | 69 | result = bitbake("logging-test -c pythontest_exec_func_shell -f -v", |
| @@ -68,6 +73,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 68 | self.assertCount(result.output, "This is shell stdout", 2) | 73 | self.assertCount(result.output, "This is shell stdout", 2) |
| 69 | self.assertCount(result.output, "This is shell stderr", 2) | 74 | self.assertCount(result.output, "This is shell stderr", 2) |
| 70 | 75 | ||
| 76 | def test_python_exec_func_shell_loggingD(self): | ||
| 71 | # logs, verbose | 77 | # logs, verbose |
| 72 | self.write_config('BBINCLUDELOGS = "yes"') | 78 | self.write_config('BBINCLUDELOGS = "yes"') |
| 73 | result = bitbake("logging-test -c pythontest_exec_func_shell -f -v", | 79 | result = bitbake("logging-test -c pythontest_exec_func_shell -f -v", |
| @@ -77,13 +83,14 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 77 | self.assertCount(result.output, "This is shell stdout", 2) | 83 | self.assertCount(result.output, "This is shell stdout", 2) |
| 78 | self.assertCount(result.output, "This is shell stderr", 2) | 84 | self.assertCount(result.output, "This is shell stderr", 2) |
| 79 | 85 | ||
| 80 | def test_python_exit_logging(self): | 86 | def test_python_exit_loggingA(self): |
| 81 | # no logs, no verbose | 87 | # no logs, no verbose |
| 82 | self.write_config('BBINCLUDELOGS = ""') | 88 | self.write_config('BBINCLUDELOGS = ""') |
| 83 | result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True) | 89 | result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True) |
| 84 | self.assertIn("ERROR: Logfile of failure stored in:", result.output) | 90 | self.assertIn("ERROR: Logfile of failure stored in:", result.output) |
| 85 | self.assertNotIn("This is python stdout", result.output) | 91 | self.assertNotIn("This is python stdout", result.output) |
| 86 | 92 | ||
| 93 | def test_python_exit_loggingB(self): | ||
| 87 | # logs, no verbose | 94 | # logs, no verbose |
| 88 | self.write_config('BBINCLUDELOGS = "yes"') | 95 | self.write_config('BBINCLUDELOGS = "yes"') |
| 89 | result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True) | 96 | result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True) |
| @@ -91,6 +98,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 91 | # A sys.exit() should include the output | 98 | # A sys.exit() should include the output |
| 92 | self.assertCount(result.output, "This is python stdout", 1) | 99 | self.assertCount(result.output, "This is python stdout", 1) |
| 93 | 100 | ||
| 101 | def test_python_exit_loggingC(self): | ||
| 94 | # no logs, verbose | 102 | # no logs, verbose |
| 95 | self.write_config('BBINCLUDELOGS = ""') | 103 | self.write_config('BBINCLUDELOGS = ""') |
| 96 | result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True) | 104 | result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True) |
| @@ -98,6 +106,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 98 | # python tasks don't log output with -v currently | 106 | # python tasks don't log output with -v currently |
| 99 | #self.assertCount(result.output, "This is python stdout", 1) | 107 | #self.assertCount(result.output, "This is python stdout", 1) |
| 100 | 108 | ||
| 109 | def test_python_exit_loggingD(self): | ||
| 101 | # logs, verbose | 110 | # logs, verbose |
| 102 | self.write_config('BBINCLUDELOGS = "yes"') | 111 | self.write_config('BBINCLUDELOGS = "yes"') |
| 103 | result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True) | 112 | result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True) |
| @@ -105,7 +114,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 105 | # python tasks don't log output with -v currently | 114 | # python tasks don't log output with -v currently |
| 106 | #self.assertCount(result.output, "This is python stdout", 1) | 115 | #self.assertCount(result.output, "This is python stdout", 1) |
| 107 | 116 | ||
| 108 | def test_python_exec_func_python_logging(self): | 117 | def test_python_exec_func_python_loggingA(self): |
| 109 | # no logs, no verbose | 118 | # no logs, no verbose |
| 110 | self.write_config('BBINCLUDELOGS = ""') | 119 | self.write_config('BBINCLUDELOGS = ""') |
| 111 | result = bitbake("logging-test -c pythontest_exec_func_python -f", | 120 | result = bitbake("logging-test -c pythontest_exec_func_python -f", |
| @@ -113,6 +122,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 113 | self.assertIn("ERROR: Logfile of failure stored in:", result.output) | 122 | self.assertIn("ERROR: Logfile of failure stored in:", result.output) |
| 114 | self.assertNotIn("This is python stdout", result.output) | 123 | self.assertNotIn("This is python stdout", result.output) |
| 115 | 124 | ||
| 125 | def test_python_exec_func_python_loggingB(self): | ||
| 116 | # logs, no verbose | 126 | # logs, no verbose |
| 117 | self.write_config('BBINCLUDELOGS = "yes"') | 127 | self.write_config('BBINCLUDELOGS = "yes"') |
| 118 | result = bitbake("logging-test -c pythontest_exec_func_python -f", | 128 | result = bitbake("logging-test -c pythontest_exec_func_python -f", |
| @@ -121,6 +131,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 121 | # A sys.exit() should include the output | 131 | # A sys.exit() should include the output |
| 122 | self.assertCount(result.output, "This is python stdout", 1) | 132 | self.assertCount(result.output, "This is python stdout", 1) |
| 123 | 133 | ||
| 134 | def test_python_exec_func_python_loggingC(self): | ||
| 124 | # no logs, verbose | 135 | # no logs, verbose |
| 125 | self.write_config('BBINCLUDELOGS = ""') | 136 | self.write_config('BBINCLUDELOGS = ""') |
| 126 | result = bitbake("logging-test -c pythontest_exec_func_python -f -v", | 137 | result = bitbake("logging-test -c pythontest_exec_func_python -f -v", |
| @@ -129,6 +140,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 129 | # python tasks don't log output with -v currently | 140 | # python tasks don't log output with -v currently |
| 130 | #self.assertCount(result.output, "This is python stdout", 1) | 141 | #self.assertCount(result.output, "This is python stdout", 1) |
| 131 | 142 | ||
| 143 | def test_python_exec_func_python_loggingD(self): | ||
| 132 | # logs, verbose | 144 | # logs, verbose |
| 133 | self.write_config('BBINCLUDELOGS = "yes"') | 145 | self.write_config('BBINCLUDELOGS = "yes"') |
| 134 | result = bitbake("logging-test -c pythontest_exec_func_python -f -v", | 146 | result = bitbake("logging-test -c pythontest_exec_func_python -f -v", |
| @@ -137,7 +149,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 137 | # python tasks don't log output with -v currently | 149 | # python tasks don't log output with -v currently |
| 138 | #self.assertCount(result.output, "This is python stdout", 1) | 150 | #self.assertCount(result.output, "This is python stdout", 1) |
| 139 | 151 | ||
| 140 | def test_python_fatal_logging(self): | 152 | def test_python_fatal_loggingA(self): |
| 141 | # no logs, no verbose | 153 | # no logs, no verbose |
| 142 | self.write_config('BBINCLUDELOGS = ""') | 154 | self.write_config('BBINCLUDELOGS = ""') |
| 143 | result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True) | 155 | result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True) |
| @@ -145,6 +157,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 145 | self.assertNotIn("This is python fatal test stdout", result.output) | 157 | self.assertNotIn("This is python fatal test stdout", result.output) |
| 146 | self.assertCount(result.output, "This is a fatal error", 1) | 158 | self.assertCount(result.output, "This is a fatal error", 1) |
| 147 | 159 | ||
| 160 | def test_python_fatal_loggingB(self): | ||
| 148 | # logs, no verbose | 161 | # logs, no verbose |
| 149 | self.write_config('BBINCLUDELOGS = "yes"') | 162 | self.write_config('BBINCLUDELOGS = "yes"') |
| 150 | result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True) | 163 | result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True) |
| @@ -153,6 +166,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 153 | self.assertNotIn("This is python fatal test stdout", result.output) | 166 | self.assertNotIn("This is python fatal test stdout", result.output) |
| 154 | self.assertCount(result.output, "This is a fatal error", 1) | 167 | self.assertCount(result.output, "This is a fatal error", 1) |
| 155 | 168 | ||
| 169 | def test_python_fatal_loggingC(self): | ||
| 156 | # no logs, verbose | 170 | # no logs, verbose |
| 157 | self.write_config('BBINCLUDELOGS = ""') | 171 | self.write_config('BBINCLUDELOGS = ""') |
| 158 | result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True) | 172 | result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True) |
| @@ -161,6 +175,7 @@ class BitBakeLogging(OESelftestTestCase): | |||
| 161 | #self.assertCount(result.output, "This is python fatal test stdout", 1) | 175 | #self.assertCount(result.output, "This is python fatal test stdout", 1) |
| 162 | self.assertCount(result.output, "This is a fatal error", 1) | 176 | self.assertCount(result.output, "This is a fatal error", 1) |
| 163 | 177 | ||
| 178 | def test_python_fatal_loggingD(self): | ||
| 164 | # logs, verbose | 179 | # logs, verbose |
| 165 | self.write_config('BBINCLUDELOGS = "yes"') | 180 | self.write_config('BBINCLUDELOGS = "yes"') |
| 166 | result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True) | 181 | result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True) |
