summaryrefslogtreecommitdiffstats
path: root/dovetail/container.py
AgeCommit message (Collapse)AuthorFilesLines
2017-03-30Merge "dovetail tool: change function pull_image"hongbo tian1-18/+27
2017-03-30Merge "dovetail tool: set a unique build_tag for each DoveTail test"hongbo tian1-3/+4
2017-03-30dovetail tool: refstack testcase integrationMatthewLi1-0/+8
JIRA: DOVETAIL-370 Change-Id: I60c9f431358f848e24abcb865c4b2ca8c3b2d843 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
2017-03-30dovetail tool: set a unique build_tag for each DoveTail testxudan1-3/+4
JIRA: DOVETAIL-379 1. create a uuid for each test, and set build_tag=daily-master-<uuid> 2. the reason it starts with "daily_master" is that it's the requirement of functest when push data to DB. Change-Id: I9a59d5695a9f0d83bf4330379f1949a2a04f876c Signed-off-by: xudan <xudan16@huawei.com>
2017-03-30dovetail tool: change function pull_imagexudan1-18/+27
JIRA: DOVETAIL-378 1. test_runner checks the result of cmd "pull image". If fail to pull, then break the running. 2. pull_image will return None when there are errors, otherwise return image name. 3. if there is an old image named the same as the new one, the old one's tag will be changed into <none>. In this case, the old image needs to be removed. 4. if there are some containers using this old image, the remove will be skipped rather than logging error. Change-Id: I940cb18911112d5e13f3c14f87ddbdbaced3538a Signed-off-by: xudan <xudan16@huawei.com>
2017-03-29dovetail tool: offline supportMatthewLi1-0/+6
JIRA: DOVETAIL-164 usage: dovetail run --testsuite <testsuite> --offline 1,if --offline given, can run offline by using local docker images (if there is no images, will get an error in log, images can be pulled from dockerhub or downloaded from artifacts.opnfv.org ) 2,if --offline not given, will run online, which means pull docker image from dockerhub Change-Id: I87ab35c82e59fb13a7a88c38d233e89285efc4d3 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
2017-03-25dovetail tool: Add an option cmd for pushing results into DBxudan1-25/+63
JIRA: DOVETAIL-373 1. add an option --report/-r to choose the report type. 2. "-r file" will store results with files. 3. "-r http://192.168.135.2:8000/api/v1" will push results into DB. The DB url can replaced by user's local DB or official DB. 4. Default report type is defined as "report_dest" in dovetail_config.yml. 5. Yardstick can't push results of one testcase into DB now, so both "-r file" and "-r http://..." will be regarded as "file". Change-Id: Ieaa017ab59c5b15235bf306ef57cdc56beb22af8 Signed-off-by: xudan <xudan16@huawei.com>
2017-03-22Merge "dovetail tool: Bugfix about the prepare_env of yardstick and get the ↵hongbo tian1-2/+5
yardstick.log"
2017-03-21dovetail tool: remove installer and CI related variablesxudan1-1/+21
JIRA: DOVETAIL-371 1. remove all the envs in functest_config.yml and yardstick_config.yml 2. remove all relative cmds in cmd_config.yml 3. remove all the envs when running a new functest/yardstick container 4. add some variables just for functest pushing results to db 5. get the external network name for yardstick 6. make --debug/-d just control the log level shown on the screen 7. set requests=2.10.0 since python-openstackclient needs 'requests!=2.12.2,!=2.13.0,>=2.10.0' Change-Id: I9f941e09d067fc95a14c3c9be1374f41df4a9a16 Signed-off-by: xudan <xudan16@huawei.com>
2017-03-21dovetail tool: Bugfix about the prepare_env of yardstick and get the ↵xudan1-2/+5
yardstick.log 1. For Fuel, yardstick prepare_env.sh will fail when pwd != /home/opnfv/repos/yardstick 2. Modify yardstick_config.yml in Dovetail to change pwd to that path. 3. Use log file /tmp/yardstick/yardstick.log created by cmd "yardstick task start" rather than redirecting the console output to yardstick.log. JIRA: DOVETAIL-363 Change-Id: Ie0475cfabc66e342be868f0924a5fccd6fa74b58 Signed-off-by: xudan <xudan16@huawei.com>
2017-03-20dovetail tool: change name of credentials from creds to openrcxudan1-6/+9
1. change file name from openstack.creds to openrc.sh 2. change the cmd --creds to --openrc/-o 3. now the path of --openrc can be relative path no restrict to abspath 4. remove the useless "work_dir" in dovetail_config.yml JIRA: DOVETAIL-369 JIRA: DOVETAIL-367 Change-Id: I2592438eef060f84132ff7fa226aea93ea947362 Signed-off-by: xudan <xudan16@huawei.com>
2017-01-20dovetail tool: use python new-style classes which inherit from objectxudan1-1/+1
JIRA: DOVETAIL-187 Change-Id: Id6fa50a3a3cec7a18d27ca8feb383b53836a339b Signed-off-by: xudan <xudan16@huawei.com>
2017-01-06dovetail tool: remove old image when pulling new one successfullyxudan1-10/+54
1. split function pull_image into four functions, get_image_id, pull_image_only, remove_image and pull_image. 2. after pulling new version of the image, remove the old one with tag <none>. JIRA: DOVETAIL-171 Change-Id: I2d2a9d6a8bc2308d434d0a3c76aa24bf5b39bfd7 Signed-off-by: xudan <xudan16@huawei.com>
2016-12-26Merge "dovetail tool: bugfix functest prepare_env fail"hongbo tian1-2/+8
2016-12-22dovetail tool: bugfix functest prepare_env failxudan1-2/+8
JIRA: DOVETAIL-169 Change-Id: I7ede8713c16b084255f691505a39db122fdbe8ea Signed-off-by: xudan <xudan16@huawei.com>
2016-12-22[dovetail tool]check and get results for each cmdLeo Wang1-4/+6
JIRA: DOVETAIL-166 Check the results of each cmds executed in test case 1. the results of pre_condition, post_condition, cmds need to be checked, so it can get a quick fail, dont need to go through the next step 2. it's more accurate to show where error occurred as early as possible 3. get results from shell scripts Change-Id: I5c1e59839c55b92de0e83e7e1eb552aa364b3f80 Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
2016-12-21Merge "updated the process flow of function exec_cmd"hongbo tian1-2/+2
2016-12-19Merge "dovetail tool: move conf/dovetail_config.py into utils/"hongbo tian1-1/+1
2016-12-18[dovetail tool] fetch openstack rc files without installer infoLeo Wang1-2/+4
JIRA: DOVETAIL-157 dovetail tool must not depend on any installers or any SUT, so openstack rc files need to be provided to eliminate this dependency. 1. input parameters "SUT_IP"/"SUT_TYPE" must be optional, may be finally will be removed 2. new parameter "creds" to specify the file used to get access to openstack of SUT Change-Id: I877efb2a6abc198c32ed6d52b9418a35597d5867 Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
2016-12-16updated the process flow of function exec_cmdRyan.RCS1-2/+2
separate the log expressions to other functions removed statements that not necessary output error detail info in exception Change-Id: I721611d61dee83eb5f40ee954d433073114e231a JIRA: DOVETAIL-161 Signed-off-by: Ryan.RCS <lihainong@huawei.com>
2016-12-15dovetail tool: move conf/dovetail_config.py into utils/xudan1-1/+1
1. move conf/dovetail_config.py into utils/ 2. change the open file path in dovetail_config.py 3. do some modification about all 'from conf.dovetail_config import ***' JIRA: DOVETAIL-158 Change-Id: I7670e6de993899e4e2a604cbc501dc3339896ef1 Signed-off-by: xudan <xudan16@huawei.com>
2016-12-14[dovetail tool] support shell scripts for testcase validationLeo Wang1-0/+2
JIRA: DOVETAIL-46 1. for now a testcase has two kinds of validation types(functest, yardstick), and it is not enough to check the complete funcionality 2. add new validation type(shell) for extra validation of the test case to make result more accurate and more convincing. Change-Id: I5c049a71f11cca71a7914f8af704c1983aba3dca Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
2016-12-13Merge "[WIP] Migrate to tox based environment"hongbo tian1-1/+1
2016-12-13[WIP] Migrate to tox based environmentLeif Madsen1-1/+1
Migrate the custom setup.py to a more formal setup environment using tox, in the same way that OpenStack configures their projects. Adds metadata to tox.ini from the setup.py file, and breaks out the dependencies from setup.py into requirements.txt and test-requirements.txt. Executes flake8 testing for pep8 coverage. Defaults to using Python 2 for the environment. Change-Id: Ieaea7d9f3dc227febd8fb1dc9142d478ba197a92 Signed-off-by: Leif Madsen <lmadsen@redhat.com> Signed-off-by: zshi <zshi@redhat.com>
2016-12-09[dovetail tool]: move config info from .py to config .yml fileMatthewLi1-4/+4
JIRA: DOVETAIL-145 Change-Id: Ia9b3c678f1a491e5daf2d280f05904ead3b0a296 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
2016-12-06Copy the jumphost ssh key into the containerDan Radez1-2/+1
When functest runs against Apex it needs to ssh from the container to the undercloud to get the keystonerc file so it can authenticate to the overcloud. Change-Id: Iea3273d4d1611733f167ffab0b2a75330c413edc Signed-off-by: Dan Radez <dradez@redhat.com>
2016-11-29dovetail tool: package all logger initializationxudan1-12/+18
1. For container.py, parser.py, report.py and testcase.py, they use functions in classes to create loggers. So each class will have its own logger. 2. run.py will create all the loggers by create_logs() function before the use of them. So logs will not be initialized until the call of create_logs(). 3. Move logger in run.py into function main(). JIRA: DOVETAIL-56 Change-Id: I53de090df270cc7a34762ff99cbc9115cfb09465 Signed-off-by: xudan <xudan16@huawei.com>
2016-11-17dovetail tool: reorganize dovetail_config.py and modify related filesxudan1-3/+4
1. move all sentencs and functions into class DovetailConfig 2. delete dict container_config for it has been replaced by dovetail_config 2. modify files that import dovetail_config, including container.py, parser.py, report.py, run.py, dovetail_logger.py and testcase.py JIRA: DOVETAIL-55 Change-Id: Ib5ca3cadd751075c879f39e8cb2eb2e0adcef6aa Signed-off-by: xudan <xudan16@huawei.com>
2016-11-15dovetail tool: replace the hard-coded "Tescase" and modify some classmethodLinghui Zeng1-6/+6
JIRA: DOVETAIL-45 1. In the testcase.py file, we replace the hard-coded "Tesecase" with "cls" or "self" based on the specific contexts. 2. For all the four committed files, we modify some classmethod into staticmethod because each method is basically just a function, called syntactically like a method, but without access to the object and its' internals (attributes and other methods). Change-Id: Ieb452f476a2d33ae9aca4c904ae7d2c92b68689e Signed-off-by: Linghui Zeng <linghui.zeng@huawei.com>
2016-11-02dovetail tool: Add cli mechanism for changing envs at run-timexudan1-8/+2
JIRA: DOVETAIL-23 1. Add file cmd_config.yml for defining arguments and options. 2. Using python click module to add and parse cmds in cmd_config.yml 3. Using envs options to update envs in yardstick/functest config file Change-Id: Ie513c0f0a1ed76f29408419a4bcbbcf21334bb3f Signed-off-by: xudan <xudan16@huawei.com>
2016-10-17Get envs from environment variables to test multi-SUTzshi1-0/+7
JIRA: DOVETAIL-32 currently envs variable is hard-coded to specific values which are not suitable for multi-SUT platform, fix it by reading it from environment variable. this commit is for apex installer testing purpose. Change-Id: I2163b96208d42a91f2795de6a55b276b803dc5e8 Signed-off-by: zshi <zshi@redhat.com>
2016-10-14[dovetail_tool] Fix the python style scanned by flake8xudan1-14/+19
JIRA: DOVETAIL-34 Change-Id: Ib9a6dd254f1d77b0cbbfa66e8e1e44df1ce14a4b Signed-off-by: xudan <xudan16@huawei.com>
2016-10-12preparation for setup.pyMatthewLi1-0/+69
JIRA: DOVETAIL-26 1)change the directory scripts to dovetail, to make it unified in OPNFV and for setup.py 2)change the paths accordingly 3)this should be first merged, since docker is changed, then to add setup.py and run the local test Change-Id: I65974bde17f310ebbfe3c025532b05dae8752945 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>