This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import avocado | |
IS_ARM = 'arm' in open('/proc/cpuinfo', 'r').read() | |
class MyTest(avocado.Test): | |
@avocado.skipIf(IS_ARM) | |
def setUp(self): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from avocado import Test | |
from avocado import main | |
from avocado.utils.process import run | |
from avocado.utils.software_manager import SoftwareManager | |
class CancelTest(Test): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from avocado import Test | |
from avocado.utils import process | |
class TestTopology(Test): | |
def setUp(self): | |
script_name = 'cpu_topology.py' | |
script_locations = ['https://gist.githubusercontent.com/apahim/' | |
'361c9358c69c93b87e926d296b49368a/raw/' | |
'bb4514984fb690fef90eb7618df9c32c9e861d01/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import glob | |
import sys | |
cputopology="/sys/devices/system/cpu/" | |
def cores(): | |
return _csiblings / _tcratio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python walking_robot.py | |
Matrix: | |
46B(1131) E59(3673) EA( 234) C1F(3103) 45E(1118) 63( 99) | |
899(2201) FFF(4095) 926(2342) 7AD(1965) C4E(3150) FFF(4095) | |
E2E(3630) 323( 803) 6D2(1746) 976(2422) 83F(2111) C96(3222) | |
9E9(2537) A8B(2699) 9C1(2497) 461(1121) F74(3956) D05(3333) | |
EDD(3805) E94(3732) 5F4(1524) D1D(3357) D03(3331) DE3(3555) | |
89( 137) 925(2341) CF9(3321) CA0(3232) F18(3864) 4D2(1234) | |
------------------------------- | |
Minimun cost from left/top to right/down: 24146 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matrix = [['46B','E59','EA','C1F','45E','63'], | |
['899','FFF','926','7AD','C4E','FFF'], | |
['E2E','323','6D2','976','83F','C96'], | |
['9E9','A8B','9C1','461','F74','D05'], | |
['EDD','E94','5F4','D1D','D03','DE3'], | |
['89','925','CF9','CA0','F18','4D2']] | |
print 'Matrix:' | |
for i in range(6): | |
for j in range(6): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AVOCADO_ALL_OK = 0 | |
AVOCADO_TESTS_FAIL = 1 | |
AVOCADO_JOB_FAIL = 2 | |
AVOCADO_FAIL = 3 | |
AVOCADO_JOB_INTERRUPTED = 4 | |
test_state(runner) | summary (runner -> job) | |
--------------------|----------------------------------- | |
SKIP | if fail_class is TimeOutSkipTest: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
import random | |
class VmsBackup(object): | |
def __init__(self): | |
self.vms = ['vm01', 'vm02', 'vm03', 'vm04', 'vm05', 'vm06', 'vm07', 'vm08', 'vm09'] | |
def get_vm_to_backup(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[apahim@hurricane tests]$ PYTHONPATH=../lib:../vdsm:../client/ avocado run `~/src/avocado/contrib/avocado-find-unittests *_test.py *_tests.py *Tests.py network` --external-runner '/usr/bin/python -m unittest' | |
JOB ID : a73d38ff01a94cccda2463f85c66b2f64268c797 | |
JOB LOG : /home/apahim/avocado/job-results/job-2016-03-10T14.35-a73d38f/job.log | |
TESTS : 1219 | |
(1/1219) commands_test.ExecCmdStressTest.test_read_stderr: PASS | |
(2/1219) commands_test.ExecCmdStressTest.test_read_stdout_stderr: PASS | |
(3/1219) commands_test.ExecCmdStressTest.test_write_stdin_read_stderr: PASS | |
(4/1219) commands_test.ExecCmdTest.testNormal: FAIL | |
(5/1219) commands_test.ExecCmdTest.testIoClass: FAIL | |
(6/1219) commands_test.ExecCmdTest.testNice: FAIL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/avocado/core/test.py b/avocado/core/test.py | |
index 0a37f75..76ffb8c 100644 | |
--- a/avocado/core/test.py | |
+++ b/avocado/core/test.py | |
@@ -207,8 +207,6 @@ class Test(unittest.TestCase): | |
""" | |
cache_dirs = settings.get_value('datadir.paths', 'cache_dirs', | |
key_type=list, default=[]) | |
- if isinstance(cache_dirs, str): | |
- cache_dirs = [cache_dirs] |