Commit Graph

11 Commits

Author SHA1 Message Date
Ghanshyam Mann 83dc573004 Retire os-win: remove repo content
Winstackers project has been retired
- https://review.opendev.org/c/openstack/governance/+/886880

this commit remove the content of os-win
deliverables of this project

Depends-On: https://review.opendev.org/c/openstack/project-config/+/894407/1
Change-Id: Ia157731a558dc66e7fc944d8e42938b2eff8afa7
2023-09-09 12:25:13 -07:00
Takashi Natsume a4effc7e54 Fix wrong assertion methods
Replcae 'has_calls' with 'assert_has_calls' or
remove 'has_calls'.

Change-Id: I65f9a761af75d94052362056fe1c9ba152f6449e
Closes-Bug: 1989280
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-09-12 20:38:19 +09:00
Sean McGinnis c995a87873
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I24c8926bc7a571b45af77c497f0791d101ebbc12
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:56:56 -05:00
Claudiu Belu 823b162c6a tests: Use mock autospec in unit tests
Autospecing will ensure that the method signatures are respected
during calls.

oslotest.mock_fixture contains 2 components, one of them adds the autospec
argument to mock.Mock and mock.MagicMock, while the other one fixes the
autospec behaviour for mock.patch functions, and sets autospec to True by
default, unless otherwise specified.

Closes-Bug: #1735588

Change-Id: I5a1dd8571988859b4a14a505fd5e016079582363
2018-01-22 08:39:13 -08:00
Jenkins 88db49ebf8 Merge "vmutils: Planned VMs separation" 2017-07-04 11:08:45 +00:00
Claudiu Belu 6772315353 vmutils: Planned VMs separation
A Planned VM and a Realized VM cannot exist at the time on the
same host, The 2 types must be treated separately.

vm_exists will only check if the Realized VM exists.
planned_vm_exists will only check if the Planned VM exists.
destroy_planned_vm will only destroy the planned VM, if it exists.

Related-Bug: #1604078

Change-Id: I91636a82b057f566eab9887c422911163668f556
2017-07-03 11:14:53 +03:00
Claudiu Belu 49a012e83c Fixes cached old WMI service objects issue
When using WMI, the resources passed to the
Msvm_VirtualSystemManagementService are not cleaned up
by the garbage collector if the Service object is still
referenced (cached as a property in BaseUtilsVirt).

PyMI doesn't have this issue, so the Service objects can be
safely cached.

This issue only affects Windows / Hyper-V Server 2012.

Change-Id: If8df0bf0a2f13a9e94993dde8b2a18943f2e9f83
Closes-Bug: #1697389
2017-06-14 02:19:39 -07:00
Claudiu Belu 973f50ff1d Uses _compat_conn where WMI objects need to be updated or added
This patch only affects Windows / Hyper-V Server 2012.

On Windows / Hyper-V Server 2012_compat_conn represents the old WMI
connection, in order to ensure that the add / update operations work
properly, since PyMI's and WMI's GetText_(1) outputs are different,
causing an issue on 2012.

Closes-Bug: #1678968

Change-Id: I5542046375114c24387cbcfba0aa8528f8e0dd6d
2017-04-03 14:41:57 +00:00
Claudiu Belu 8c8517ec0f Replaces CRLF line endings to LF line endings
A previous commit introduced new files with CRLF line endings.
They need to be changed to LF endings, to be like the rest of
the repository

Change-Id: I054270e0aec6b7b94c92659bcd8c1cd1ebaeabef
2017-03-30 09:51:06 -07:00
Claudiu Belu c02446468d Rearrange imports
The imports should be split into: native, 3rd party, and
project imports. However, there are some cases in which
this isn't true.

Change-Id: I6d1c0c13c8c258c669f78473aecde0d771af38ba
2017-01-20 16:15:08 +02:00
Lucian Petrut 45b07177e9 Move unit tests to a separate folder
Until recently, os-win did not have any functional tests. As we're
now starting to add such tests, we need to clearly separate unit
tests.

Note that most OpenStack projects have already done this separation.

This change moves the unit tests to a separate folder.

Change-Id: I1649fae7095f9b4024e526358ac70a58189365bf
2016-10-17 14:25:45 +03:00