Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a28feec
2to3marvin
DaanHoogland Dec 14, 2020
408b0f7
2to3tests
DaanHoogland Dec 14, 2020
f8aba4e
init and sign
DaanHoogland Dec 14, 2020
63d6cce
explicit import of unittest
DaanHoogland Nov 26, 2020
d2eb673
expect explicit exception
Dec 3, 2020
d90d2dd
remove redundant member value
DaanHoogland Dec 9, 2020
aca11af
env run of python3
DaanHoogland Dec 15, 2020
46a6f69
travis on python 3
Dec 16, 2020
7be13a8
version3
Dec 16, 2020
381b77a
urllib3
DaanHoogland Dec 17, 2020
a423115
python3 output on code generator
Dec 22, 2020
81ae384
call codegenerator with python3
Jan 22, 2021
c70da7a
add urllib3 to requirements in egg
Jan 22, 2021
4dcd3d9
None check
Jan 26, 2021
b7a3de2
travis scripts
Jan 26, 2021
b0b93d8
pyenv/travis alignment
Jan 27, 2021
4b32234
pyton 3.9.1
Jan 27, 2021
c021057
pyenv the right/requested version
Feb 1, 2021
e0c369f
python3 in marvin rpm
Feb 1, 2021
7ca6610
marvin deps on nose
Feb 2, 2021
51e9c09
pycodestyle2 and -lint2 in travis
Feb 4, 2021
3a6591e
string checks in the nose plugin
Feb 4, 2021
31bd0c6
no decode on str in python3
Feb 5, 2021
b7b345c
channel result decode
Feb 9, 2021
68ba4df
fix tags on test
Feb 9, 2021
e34f03c
backquote error calling pyenv
Feb 9, 2021
0d1efb2
run py checkers as modules
Feb 10, 2021
d45506b
remove nose-json
Feb 10, 2021
e335c69
travis systemvm tests
Feb 10, 2021
079b8d2
travis prefered python version
DaanHoogland Feb 10, 2021
f367fdb
travis container does not inherit before_install stuff??
Feb 10, 2021
191995f
travis container does not inherit pylint either
Feb 10, 2021
f86ca13
separate python for systemvm (tests)
Feb 10, 2021
3e29ffa
Revert "travis systemvm tests"
Feb 10, 2021
92eaa88
version output in svm tests
Feb 10, 2021
4654858
pylint/travis trouble
Feb 11, 2021
5b3f92b
certificates as bytes arrays
Feb 11, 2021
49b976f
license exclude for pyenv
Feb 11, 2021
7669752
start on tabs in component tests :'(
Feb 12, 2021
becb14d
add dep for python browsing in IDE
Feb 12, 2021
1709c85
mysql connector does not properly defend against index out of bounds
Feb 12, 2021
1cd8a16
Revert "add dep for python browsing in IDE"
Feb 13, 2021
fec944d
only fetchall for select statements
Feb 16, 2021
74c3cfb
awkward encode-decode of userdata
Feb 19, 2021
55577ec
unittest method rename assertItemEqual to assertCountEqual
Feb 19, 2021
ada5711
foutje bedank: None vs 0
Feb 19, 2021
28dad23
str() when str() due
Feb 22, 2021
8694d4a
remove superfluent parentesis
Feb 22, 2021
cd59c98
preserver root cause on storage migration failure
Feb 22, 2021
56cd219
exception assert fix
Feb 22, 2021
efb7d97
2to3 artifact/remnance removed
Feb 22, 2021
661e9d8
inherritics
Feb 22, 2021
2782dc1
socketserver take bytes
Feb 22, 2021
48a047c
cleanup of setup() (not sure why this would help)
Feb 23, 2021
ae192a6
cleanup
Feb 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
system
3.6
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jdk:
- openjdk11

python:
- "2.7"
- "3.9"

node_js:
- 12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ public void copyAsync(Map<VolumeInfo, DataStore> volumeDataStoreMap, VirtualMach
catch (Exception ex) {
errMsg = "Copy operation failed in 'StorageSystemDataMotionStrategy.copyAsync': " + ex.getMessage();

throw new CloudRuntimeException(errMsg);
throw new CloudRuntimeException(errMsg, ex);
}
finally {
CopyCmdAnswer copyCmdAnswer = new CopyCmdAnswer(errMsg);
Expand Down
11 changes: 11 additions & 0 deletions packaging/centos7/cloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ BuildRequires: /usr/bin/mkisofs
BuildRequires: mysql-connector-python
BuildRequires: maven => 3.0.0
BuildRequires: python-setuptools
BuildRequires: python3
BuildRequires: python3-pip
BuildRequires: python3-setuptools
BuildRequires: wget
BuildRequires: nodejs

Expand Down Expand Up @@ -153,6 +156,9 @@ Apache CloudStack command line interface

%package marvin
Summary: Apache CloudStack Marvin library
Requires: python3
Requires: python3-devel
Requires: python3-pip
Requires: python-pip
Requires: gcc
Requires: python-devel
Expand Down Expand Up @@ -418,6 +424,8 @@ fi
# Install mysql-connector-python
pip3 install %{_datadir}/%{name}-management/setup/wheel/six-1.15.0-py2.py3-none-any.whl %{_datadir}/%{name}-management/setup/wheel/setuptools-47.3.1-py3-none-any.whl %{_datadir}/%{name}-management/setup/wheel/protobuf-3.12.2-cp36-cp36m-manylinux1_x86_64.whl %{_datadir}/%{name}-management/setup/wheel/mysql_connector_python-8.0.20-cp36-cp36m-manylinux1_x86_64.whl

pip3 install urllib3

/usr/bin/systemctl on cloudstack-management > /dev/null 2>&1 || true

grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
Expand Down Expand Up @@ -506,6 +514,9 @@ fi
%post marvin
pip install --upgrade https://files.pythonhosted.org/packages/ca/ea/1e2553b088bad2f9fa8120c2624f797b2d7450d3b61bb492d29c72e3d3c2/mysql_connector_python-8.0.20-cp27-cp27mu-manylinux1_x86_64.whl
pip install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
pip3 install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
pip3 install --upgrade nose
pip3 install --upgrade urllib3

#No default permission as the permission setup is complex
%files management
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@
<exclude>**/*.md</exclude>
<exclude>.java-version</exclude>
<exclude>.python-version</exclude>
<exclude>systemvm/.pythen-version</exclude>
<exclude>.idea/</exclude>
<exclude>.metadata/**</exclude>
<exclude>.git/**</exclude>
Expand Down
1 change: 1 addition & 0 deletions systemvm/.pythen-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.18
6 changes: 4 additions & 2 deletions systemvm/test/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ export PYTHONPATH="../debian/opt/cloud/bin/"
export PYTHONDONTWRITEBYTECODE=False

echo "Running pycodestyle to check systemvm/python code for errors"
pycodestyle --max-line-length=179 *py
pycodestyle --max-line-length=179 --exclude=monitorServices.py,baremetal-vr.py,passwd_server_ip.py `find ../debian -name \*.py`
python -m pycodestyle --max-line-length=179 *py
python -m pycodestyle --max-line-length=179 --exclude=monitorServices.py,baremetal-vr.py,passwd_server_ip.py `find ../debian -name \*.py`
if [ $? -gt 0 ]
then
echo "pycodestyle failed, please check your code"
exit 1
fi

echo "Running pylint to check systemvm/python code for errors"
python --version
pyenv versions
pylint --disable=R,C,W *.py
pylint --disable=R,C,W `find ../debian -name \*.py`
if [ $? -gt 0 ]
Expand Down
2 changes: 1 addition & 1 deletion test/integration/component/cpu_limits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# under the License.
5 changes: 3 additions & 2 deletions test/integration/component/find_hosts_for_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.cloudstackAPI import (migrateVirtualMachine,
prepareHostForMaintenance,
cancelHostMaintenance,
Expand Down Expand Up @@ -270,4 +271,4 @@ def test_01_find_hosts_for_migration(self):

self.assertTrue(notSuitableHost is not None, "notsuitablehost should not be None")
self.debug("Suitable Hosts: %s" % suitableHost)
self.debug("Not suitable Hosts: %s" % notSuitableHost)
self.debug("Not suitable Hosts: %s" % notSuitableHost)
2 changes: 1 addition & 1 deletion test/integration/component/maint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"""
Tests that put hosts, zones, resources in to maintenance mode are here.
These will have to be run sequentiall when resources are available so as not disrupt other tests
"""
"""
3 changes: 2 additions & 1 deletion test/integration/component/maint/test_bugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# under the License.

# Import Local Modules
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.cloudstackAPI import (updateStoragePool,
resizeVolume,
listCapacity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# Test from the Marvin - Testing in Python wiki

# All tests inherit from cloudstackTestCase
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest

# Import Integration Libraries

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.utils import (validateList,
cleanup_resources,
random_gen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"""
# Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.utils import (validateList,
cleanup_resources,
random_gen)
Expand Down
25 changes: 13 additions & 12 deletions test/integration/component/maint/test_escalation_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.

from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.base import (Account,
Domain, Template, Configurations,VirtualMachine,Snapshot,ServiceOffering
)
Expand Down Expand Up @@ -161,7 +162,7 @@ def test_01_CS40139_listtemplate_with_different_pagesize(self):
account=self.account.name,
domainid=self.account.domainid)
status = validateList(listfirst500template)
self.assertEquals(
self.assertEqual(
PASS,
status[0],
"First 500 template list is empty")
Expand All @@ -173,7 +174,7 @@ def test_01_CS40139_listtemplate_with_different_pagesize(self):
account=self.account.name,
domainid=self.account.domainid)
status = validateList(listremainingtemplate)
self.assertEquals(
self.assertEqual(
PASS,
status[0],
"Next 500 template list is empty")
Expand All @@ -185,7 +186,7 @@ def test_01_CS40139_listtemplate_with_different_pagesize(self):
account=self.account.name,
domainid=self.account.domainid)
status = validateList(listalltemplate)
self.assertEquals(
self.assertEqual(
PASS,
status[0],
"entire template list is empty")
Expand Down Expand Up @@ -253,7 +254,7 @@ def test_02_template_permissions(self):
)
self.updateConfigurAndRestart("allow.public.user.templates", "true")
self.fail("Template creation passed for user")
except CloudstackAPIException as e:
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)
# Register new public template as domain admin
# Exception should be raised for registering public template
Expand All @@ -268,7 +269,7 @@ def test_02_template_permissions(self):
)
self.updateConfigurAndRestart("allow.public.user.templates", "true")
self.fail("Template creation passed for domain admin")
except CloudstackAPIException as e:
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)

if self.hypervisor.lower() in ['hyperv', 'lxc']:
Expand Down Expand Up @@ -314,7 +315,7 @@ def test_02_template_permissions(self):
)
self.updateConfigurAndRestart("allow.public.user.templates", "true")
self.fail("Template creation passed from snapshot for domain user")
except CloudstackAPIException as e:
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)

VirtualMachine.stop(user_vm_created, self.user_api_client)
Expand All @@ -324,7 +325,7 @@ def test_02_template_permissions(self):
domainid=user_account.domainid,
state="Stopped")
status = validateList(list_stopped_vms_after)
self.assertEquals(
self.assertEqual(
PASS,
status[0],
"Stopped VM is not in Stopped state"
Expand All @@ -336,7 +337,7 @@ def test_02_template_permissions(self):
)
self.updateConfigurAndRestart("allow.public.user.templates", "true")
self.fail("Template creation passed from volume for domain user")
except CloudstackAPIException as e:
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)

admin_vm_created = VirtualMachine.create(
Expand Down Expand Up @@ -378,7 +379,7 @@ def test_02_template_permissions(self):
)
self.updateConfigurAndRestart("allow.public.user.templates", "true")
self.fail("Template creation passed from snapshot for domain admin")
except CloudstackAPIException as e:
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)

VirtualMachine.stop(admin_vm_created, self.admin_api_client)
Expand All @@ -388,7 +389,7 @@ def test_02_template_permissions(self):
domainid=self.account.domainid,
state="Stopped")
status = validateList(list_stopped_vms_after)
self.assertEquals(
self.assertEqual(
PASS,
status[0],
"Stopped VM is not in Stopped state"
Expand All @@ -400,7 +401,7 @@ def test_02_template_permissions(self):
)
self.updateConfigurAndRestart("allow.public.user.templates", "true")
self.fail("Template creation passed from volume for domain admin")
except CloudstackAPIException as e:
except CloudstackAPIException as e:
self.assertRaises("Exception Raised : %s" % e)

self.updateConfigurAndRestart("allow.public.user.templates", "true")
Expand Down
3 changes: 2 additions & 1 deletion test/integration/component/maint/test_escalations_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# Test from the Marvin - Testing in Python wiki

# All tests inherit from cloudstackTestCase
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest

# Import Integration Libraries

Expand Down
3 changes: 2 additions & 1 deletion test/integration/component/maint/test_high_availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"""
# Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.cloudstackAPI import (prepareHostForMaintenance,
cancelHostMaintenance)
from marvin.lib.utils import cleanup_resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.cloudstackAPI import (migrateVirtualMachine,
prepareHostForMaintenance,
cancelHostMaintenance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.base import (VirtualMachine,
NetworkOffering,
VpcOffering,
Expand Down
15 changes: 8 additions & 7 deletions test/integration/component/maint/test_multiple_ip_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# under the License.
""" Tests for Multiple IP Ranges feature
"""
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.utils import cleanup_resources, get_process_status
from marvin.lib.base import (Account,
DiskOffering,
Expand Down Expand Up @@ -203,11 +204,11 @@ def setUp(self):
)
self.ip_range = list(
netaddr.iter_iprange(
unicode(
self.testdata["vlan_ip_range"]["startip"]), unicode(
str(
self.testdata["vlan_ip_range"]["startip"]), str(
self.testdata["vlan_ip_range"]["endip"])))
self.nic_ip = netaddr.IPAddress(
unicode(
str(
self.vm_response[0].nic[0].ipaddress))
self.debug("vm got {} as ip address".format(self.nic_ip))
self.assertIn(
Expand Down Expand Up @@ -281,11 +282,11 @@ def test_01_deploy_vm_in_new_cidr(self):
"""
self.ip_range = list(
netaddr.iter_iprange(
unicode(
self.testdata["vlan_ip_range"]["startip"]), unicode(
str(
self.testdata["vlan_ip_range"]["startip"]), str(
self.testdata["vlan_ip_range"]["endip"])))
self.nic_ip = netaddr.IPAddress(
unicode(
str(
self.vm_response[0].nic[0].ipaddress))
self.debug("vm got {} as ip address".format(self.nic_ip))
self.assertIn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.cloudstackAPI import migrateSystemVm
from marvin.lib.utils import cleanup_resources
from marvin.lib.base import (Host,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# under the License.

from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.utils import cleanup_resources
from marvin.lib.base import (Account,
Host,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# All tests inherit from cloudstack TestCase

from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.codes import FAILED, PASS
from marvin.lib.base import (Account,
VirtualMachine,
Expand Down
3 changes: 2 additions & 1 deletion test/integration/component/maint/testpath_vMotion_vmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
""" Test cases for Test Paths Storage Migration
"""
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.utils import (cleanup_resources,
validateList,
is_server_ssh_ready
Expand Down
Loading