xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

python3 supporting #195

Closed robin2008 closed 5 years ago

robin2008 commented 5 years ago

Trigger CI on master branch, and CI could ensure python2 is working.

UT it on a python3 environtment:

python --version
Python 3.5.2

And need to workaround /opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper to use /usr/bin/python2

sudo bash -c '. /etc/profile.d/xcat.sh &&  xcattest -f /root/xcat.conf -s inventory_ci > /tmp/mylog1'

grep END /tmp/mylog1|grep Failed
------END::xcat_inventory_diff_files_filename::Failed::Time:Wed May  8 05:56:36 2019 ::Duration::1 sec------
------END::backend::Failed::Time:Wed May  8 06:17:57 2019 ::Duration::360 sec------
------END::xcat_inventory_diff_source::Failed::Time:Wed May  8 06:20:11 2019 ::Duration::10 sec------
------END::xcat_inventory_diff_files::Failed::Time:Wed May  8 06:27:01 2019 ::Duration::1 sec------

The failed cases is caused by the python3, but the hard code in test cases.

robin2008 commented 5 years ago

For example, the failed diff case show as below: it is cased by the envionrment does not meet the test case requirement.

>     },
>     "site": {
>         "clustersite": {
> -            "xcatdebugmode": "1",
> -            "domain": "test.com",
> -            "master": "10.1.1.2",
> -            "forwarders": "10.0.0.1"
> +            "xcatdebugmode": "0",
> +            "domain": "cluster.com",
> +            "master": "10.1.1.1"
>         }
>     },
>     "network": {
>         "10_0_0_0-255_0_0_0": {
>             "basic_attr": {
> -                "mgtifname": "eth1"
> +                "mgtifname": "eth0"
CHECK:rc == 0     [Failed]
immarvin commented 5 years ago

agree to merge