Sebastian Gebhard [Tue, 20 Aug 2013 10:44:05 +0000 (10:44 +0000)]
Minor documentations fixed to gnt-node man page
Fix two grammatical errors in gnt-node man page
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:05 +0000 (10:44 +0000)]
Documentation of new node parameters
This will add the new node parameters to the ganeti man page.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:05 +0000 (10:44 +0000)]
Add parameters for OpenvSwitch to gnt-node
Extend gnt-node by parameters for OpenvSwitch. --ovs Flag to enable
OpenvSwitch, --ovs-name for the name of the OpenvSwitch and --ovs-link
for the interface to connect to.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:04 +0000 (10:44 +0000)]
Add RPC functionality for creating OpenvSwitches
This patches adds the needed RPC functions in order to create the
OpenvSwitches on the nodes.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:04 +0000 (10:44 +0000)]
Add OpenvSwitch functionality to LUNodeAdd
This patch adds functionality to LUNodeAdd to
- check the arguments given. It will warn if no physical link is given
and fail if OpenvSwitch is not enabled, but parameters are given
- call the RPC to configure OpenvSwitch on the node
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:03 +0000 (10:44 +0000)]
Backend: Create openvswitches on the nodes
This is the functionality to create the OpenvSwitches on the nodes.
Parameters are given via opcode and checked as well as extended with
the defaults.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:03 +0000 (10:44 +0000)]
Add params for OpenvSwitch to ndparams
This patch introduces the needed fields for OpenvSwitch parameters
into ndparams and also provides the default values.
The parameters are:
ND_OVS: boolean, to show whether OpenvSwitch is enabled or not
ND_OVS_NAME: the name of the OpenvSwitch to create
ND_OVS_LINK: the physical link to the OpenvSwitch
While ND_OVS and ND_OVS_NAME are mandatory and default to FALSE and
constants.DEFAULT_OVS respectively, ND_OVS_LINK is optional and can
be left empty.
Adding a new node with OpenvSwitch and no physical interface might
or might not be what the user wants, so this case will result in a
warning to inform the user (see later patch in this series).
This patch also fixes unittests which are using these parameters.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:02 +0000 (10:44 +0000)]
Add design for OpenvSwitch autoconfiguration
This design doc adds details about how the autoconfiguration of
openvswitch should work in the cluster <-> node group <-> node
hierarchy. Parameters that are needed for succesful configration
are idenfied and inheritance of parameters is defined.
Also, some rephrasing of the definition in the first part of the
document. After looking into gnt-network, in my opinion it is not the
right place to put the switch management into, since it has more to
do with links and nics than with network names and addresses.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 13:12:54 +0000 (15:12 +0200)]
Adapt tests for merged changes in IPolicy handling
The enabled disk templates in IPolicies are stricter checked after the
merge from 2.9, so adapt the tests to follow those changes.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 13:52:30 +0000 (15:52 +0200)]
Add unit tests for LUInstanceMultiAlloc
This patch adds unit test coverage for LUInstanceMultiAlloc.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 13:16:45 +0000 (15:16 +0200)]
Add unit test for LUInstanceRename
This patch adds unit test coverage for LUInstanceRename.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 12:11:55 +0000 (14:11 +0200)]
Add basic unit tests for instance import
This patch adds basic unit tests for instance import in
LUInstanceCreate. It does not provide full coverage though.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 08:34:46 +0000 (10:34 +0200)]
Introduce GetMockLU and reduce use of _FakeLU
Introduce a new method of creating a mocked LU for tests, and reduce the
use of the legacy _FakeLU class.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 07:54:21 +0000 (09:54 +0200)]
Add unit tests for LUInstanceRemove and -Move
This patch adds unit test coverage for LUInstanceRemove and
LUInstanceMove.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 14 Aug 2013 12:18:56 +0000 (14:18 +0200)]
Add unit tests for LUInstanceCreate and move tests
- Move instance related tests to instance_unittest.py
- Adapt moved tests to the new test framework where appropriate
- Add unit test coverage for LUInstanceCreate
- Only instance creation is covered yet, no imports
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 14 Aug 2013 13:26:00 +0000 (15:26 +0200)]
disk_template param is optional in instance create
The disk_template parameter is optional during disk create (the first
enabled disk template is taken in this case), so don't require it.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 21 Aug 2013 06:36:20 +0000 (08:36 +0200)]
Merge branch 'stable-2.9' into master
* stable-2.9
Allow instance mods if only osparams are given
Use node UUIDs for locking instead of node names
Allow instance mods if only osparams are given
Fix a node name vs. UUID bug in instance import
Typo in hroller man page
Use node UUID for locking in LUInstanceMove
Fix harep manpage title
Fix IPolicy violation check in LUGroupSetParams
Use FQDN to check master node status
Revert "Display node name instead of UUID in error message"
Display node name instead of UUID in error message
Use node name in error message
QA: make ipolicy test respect enabled disk templates
QA: adjust tests wrt to ipolicy disk templates
ClusterSetParams: move vg-name checks from to CheckPrereq
man gnt-cluster: mention ipolicy check
Update NEWS file regarding ipolicy checks
gnt-group add/modify: ipolicy vs disk templates
Move Ipolicy utility function to cmdlib/common.py
bootstrap: restrict ipolicy to enabled disk templates
gnt-cluster modify: ipolicy vs enabled disk templates
gnt-cluster modify: factor out ipolicy check
Conflicts:
lib/cmdlib/group.py (due to moved function, changes already in
master)
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Thu, 25 Jul 2013 09:13:39 +0000 (11:13 +0200)]
Design document for automatised upgrades
This design document describes how upgrade and downgrades
can be made more automatic for future versions.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 12:20:52 +0000 (14:20 +0200)]
Merge branch 'stable-2.8' into stable-2.9
* stable-2.8
Allow instance mods if only osparams are given
Fix harep manpage title
Use FQDN to check master node status
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 10:37:08 +0000 (12:37 +0200)]
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those without
other changes works too now.
(cherry picked from commit
5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 13:51:23 +0000 (15:51 +0200)]
Use node UUIDs for locking instead of node names
LUInstanceMultiAlloc used node names instead of node UUIDs to lock
required nodes. This patch fixes this bug.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Thu, 8 Aug 2013 13:42:40 +0000 (15:42 +0200)]
Set pcre version to 0.94.4
Running 'make' in the chroot complains about pcre 0.94.4
being required.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 10:37:08 +0000 (12:37 +0200)]
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those without
other changes works too now.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 12:10:18 +0000 (14:10 +0200)]
Fix a node name vs. UUID bug in instance import
This patch fixes a bug where node names were incorrectly used as node
UUID's.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Helga Velroyen [Mon, 19 Aug 2013 11:22:43 +0000 (13:22 +0200)]
Typo in hroller man page
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 07:53:12 +0000 (09:53 +0200)]
Use node UUID for locking in LUInstanceMove
This LU (incorrectly) used the node name for locking. This patch
corrects this error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Apollon Oikonomopoulos [Fri, 16 Aug 2013 11:58:03 +0000 (14:58 +0300)]
Fix harep manpage title
The harep manpage title underline was one character short, leading in
pandoc producing an invalid manpage header.
Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 14:00:41 +0000 (16:00 +0200)]
Add unit test for LUGroupVerifyDisks
This patch adds unit test coverage for LUGroupVerifyDisks.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 12:32:41 +0000 (14:32 +0200)]
Add unit test for LUGroupEvacuate
This patch adds unit test coverage for LUGroupEvacuate.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 12:01:12 +0000 (14:01 +0200)]
Add unit tests for LUGroupRename
This patch adds unit test coverage for LUGroupRename.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 11:56:36 +0000 (13:56 +0200)]
Add unit tests for LUGroupRemove
This patch adds unit test coverage for LUGroupRemove.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:58:41 +0000 (11:58 +0200)]
Add unit tests for LUGroupSetParams
This adds unit test coverage for LUGroupSetParams.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:17:46 +0000 (11:17 +0200)]
Add unit test for LUGroupQuery
Provide unit test coverage for LUGroupQuery.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 08:58:44 +0000 (10:58 +0200)]
Add unit tests for LUGroupAssignNodes
Add unit test coverage for LUGroupAssignNodes, including the split
instances check.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 08:28:44 +0000 (10:28 +0200)]
Add unit tests for LUGroupAdd
Provide unit test coverage for LUGroupAdd.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 14:50:56 +0000 (16:50 +0200)]
Move TestLUGroupAssignNodes to group_unittest.py
While moving the test, it is adapted to the new test framework.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:54:52 +0000 (11:54 +0200)]
Fix IPolicy violation check in LUGroupSetParams
cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list of
instance objects which is required by ComputeNewInstanceViolations.
This patch fixes this type error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:54:52 +0000 (11:54 +0200)]
Fix IPolicy violation check in LUGroupSetParams
cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list of
instance objects which is required by ComputeNewInstanceViolations.
This patch fixes this type error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 07:50:42 +0000 (09:50 +0200)]
Use FQDN to check master node status
The master node name in SS conf is stored as FQDN, so also use the FQDN
on each node to check if it is the master node.
This fixes issue 551.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 14:07:29 +0000 (16:07 +0200)]
Add test for LUClusterVerifyDisks
This LU only creates additional jobs as result, so this is a trivial
unit test.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 05:25:57 +0000 (07:25 +0200)]
Extend unit tests for LUClusterVerifyGroup
- Add tests for additional Verify* methods
- Converted test for VerifyFiles to the new test framework
- Added possibility to prepare the LU in a test class before actually
executing the test method with it
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 06:55:29 +0000 (08:55 +0200)]
Revert "Display node name instead of UUID in error message"
This reverts commit
fbff213691328562cc4029f3babaa2e72e2012c4.
When running hooks, the node name is used to identify nodes, not (as
wrongly assumed in the patch) the node UUID.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 13:56:00 +0000 (15:56 +0200)]
Display node name instead of UUID in error message
The hooks callback in LUClusterGroupVerify misinterpreted the key in the
node result as name instead of node UUID. This patch fixes this, which
leads to more user friendly error messages.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 07:10:17 +0000 (09:10 +0200)]
Use node name in error message
CheckNodeNotDrained displayed only the node UUID if the node is drained.
In order to provide a more helpful error message, use the node name
instead.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Sebastian Gebhard [Thu, 8 Aug 2013 17:00:07 +0000 (19:00 +0200)]
Remove duplicate argument from cabal install
network==2.3 is duplicate in cabal install. One occurrence can thus be removed.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Sebastian Gebhard [Fri, 9 Aug 2013 06:43:33 +0000 (08:43 +0200)]
Typo fix in lib/server/noded.py
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Thu, 8 Aug 2013 16:41:45 +0000 (18:41 +0200)]
QA: make ipolicy test respect enabled disk templates
This makes the 'gnt-cluster modify --ipolicy-*' tests
respect the enabled disk templates on the QA cluster.
If the required disk templates are not enabled, the
test is skipped.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 13:39:14 +0000 (15:39 +0200)]
QA: adjust tests wrt to ipolicy disk templates
This adjusts the cluster QA with respect to the new checks
between the ipolicy disk templates and the enabled disk
templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 15:52:38 +0000 (17:52 +0200)]
ClusterSetParams: move vg-name checks from to CheckPrereq
This fixes a bug in the logic of 'gnt-cluster modify'.
Some checks that should better be done in 'CheckPrereq'
were actually done in 'Exec'. This lead to a strange
behavior in case the execution failed, because an
inconsistent state of the cluster's config was kept in
memory.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 12:30:21 +0000 (14:30 +0200)]
man gnt-cluster: mention ipolicy check
This updates the 'gnt-cluster' man page to mention the
relationship between the ipolicy's list of allowed disk
templates and the cluster-wide enabled-disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 12:26:37 +0000 (14:26 +0200)]
Update NEWS file regarding ipolicy checks
This patch updates the NEWS file to mention the new checks
between the ipolicy's list of allowed disk tempaltes and
the cluster-wide enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 12:08:51 +0000 (14:08 +0200)]
gnt-group add/modify: ipolicy vs disk templates
This patch adds a consistency check between the ipolicy's
list of allowed disk templates with the cluster-wide
enable disk templates when a new node group is added
or a group is modified.
It also fixes a bug in gnt-group where the list of allowed
disk templates was not propagated properly.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 11:50:27 +0000 (13:50 +0200)]
Move Ipolicy utility function to cmdlib/common.py
Since the check of consistency between an ipolicy and
the list of enabled disk templates will not only be
needed on cluster modification, but also on group
modification, we move the respective function and its
unit tests to the 'common' module.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 11:39:51 +0000 (13:39 +0200)]
bootstrap: restrict ipolicy to enabled disk templates
With this patch, on cluster creation, the initial instance
policy's list of allowed disk templates will be modified
in a way that it does not contain any disk templates which
are not enabled cluster-wise.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 11:04:45 +0000 (13:04 +0200)]
gnt-cluster modify: ipolicy vs enabled disk templates
This patch adds a check to LUClusterSetParams which
ensures that the list of allowed disk templates is a
subset of the list of cluster-wide enabled disk
templates. Unit tests are included.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 09:41:51 +0000 (11:41 +0200)]
gnt-cluster modify: factor out ipolicy check
This refactors the LUClusterSetParams to do all ipolicy
sanity / validity checks in a separate function
in order to increase testability. No function changes
otherwise.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Thu, 8 Aug 2013 15:05:25 +0000 (17:05 +0200)]
Disable pylint warning to fix build
The _CheckLUResult method gets overridden in a subclass which actually
requires the self parameter, so ignore the pylint remark about it.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Thu, 8 Aug 2013 14:01:29 +0000 (16:01 +0200)]
Add possibility to access locked LU in tests
This features is useful to test (private) methods of LU's during tests,
where those methods rely on the LU being completely initialized and
locking already performed.
An initial version of unit tests for LUClusterVerifyGroup makes use of
this feature.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Thu, 1 Aug 2013 14:46:05 +0000 (16:46 +0200)]
Add test for LUClusterVerifyConfig
Add unit test covering LUClusterVerifyConfig.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Thu, 1 Aug 2013 14:26:57 +0000 (16:26 +0200)]
Add test for LUClusterVerify
As this LU returns other jobs as result, submitting jobs from within
LU's is now mocked too.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Jose A. Lopes [Thu, 8 Aug 2013 09:49:38 +0000 (11:49 +0200)]
Fix TINicParams type predicate
Change the value type of the 'TINicParams' dictionary predicate from
'Maybe NonEmptyString' to 'Maybe String' to be compatible with the
Haskell definition.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Wed, 7 Aug 2013 15:07:06 +0000 (17:07 +0200)]
Generate text report of Haskell coverage
In order to generate a coverage graph, we generate also the coverage
data as text format. This eases parsing on Buildbot.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Jose A. Lopes [Wed, 7 Aug 2013 08:29:59 +0000 (10:29 +0200)]
Fix opcodes and parameters
* fix some return types in opcodes and some types and documentation in
parameters.
* fix serialization of the default value of the 'name' parameter in
the opcodes related to tags when tag kind is 'cluster'
* revert changes to 'pShutdownTimeout'' and its references because the
master branch tried to fix this inconsistency but was unable to fix
all the references to this parameter
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Wed, 31 Jul 2013 12:59:58 +0000 (14:59 +0200)]
Add unit test for LUClusterSetParams
Some changes to the test framework were performed while writing this
test:
- Extended builder for disks
- Introduced builder for NICs
- Fixed bugs in RpcResultsBuilder
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Thu, 1 Aug 2013 06:50:36 +0000 (08:50 +0200)]
Introduce shortcut properties for config objects
Some configuration objects are accessed quite often, so introduce
shortcut properties for those.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 30 Jul 2013 09:12:58 +0000 (11:12 +0200)]
Add unit test for LUClusterRepairDiskSizes
Also add build method for easy building of disk objects to the test
framework.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Mon, 29 Jul 2013 14:49:40 +0000 (16:49 +0200)]
Add unit test for LUClusterRename
Also mock the netutils and ssh module in order to test all code paths.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 12:52:23 +0000 (14:52 +0200)]
Use ConfigWriter.GetMasterNodeInfo() consistently
This shortcut method to get the node object of the master node directly
makes the code more readable and concise. Therefore, use it everywhere
where appropriate.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 12:50:04 +0000 (14:50 +0200)]
Add unit test for LUClusterRedistConf
Unit-test LUClusterRedistConf. Given the simplicity of the LU, this unit
test only exercises the LU code.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 12:40:18 +0000 (14:40 +0200)]
Add unit test for LUClusterQuery
Unit-test LUClusterQuery. Some changes in the mocked cluster
configuration are made, because the configuration was not completely
valid before.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 12:16:31 +0000 (14:16 +0200)]
Add unit test for LUClusterPostInit
Also extract common assertion logic for hook invocations to
CmdlibTestCase.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 11:58:14 +0000 (13:58 +0200)]
Add unit tests for LUClusterDestroy
This patch adds unit test for the LUClusterDestroy Logical Unit.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 11:57:48 +0000 (13:57 +0200)]
Add unit tests for LUClusterConfigQuery
Also, proper initialization of the runtime architecture information was
added.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 09:38:27 +0000 (11:38 +0200)]
Move cluster-related unittest to cluster_unittest
cmdlib_unittest should still be split further, but at least the cluster
related tests are moved to the proper file yet.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 09:15:16 +0000 (11:15 +0200)]
Move cmdlib-related unittests to cmdlib/
ganeti.cmdlib_unittest.py and
ganeti.cmdlib.instance_storage_unittest.py are moved to the
test/py/cmdlib directory. Also, they are renamed to match the names in
this module.
Additionally, instance_storage_unittest.py was added to the makefile, so
it's executed automatically during builds.
cmdlib_unittest.py now still contains tests from various cmdlib modules.
As soon as individual test files for those modules are added, those
tests should be move there.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 08:57:17 +0000 (10:57 +0200)]
Add unit test for LUClusterDeactivateMasterIp
This patch adds unit tests for the LUClusterDeactivateMasterIp Logical
Unit.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 24 Jul 2013 08:49:25 +0000 (10:49 +0200)]
Add unit test for LUClusterActivateMasterIp
In order to properly assert the called RPC method, __eq__ is implemented
on ConfigObject as well.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Mon, 22 Jul 2013 15:14:13 +0000 (17:14 +0200)]
Add unit test for LUTestAllocator
Additionally to adding unit tests for LUTestAllocator, the test
framework was adapted for its requirements.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Mon, 22 Jul 2013 15:56:12 +0000 (17:56 +0200)]
Remove unneeded checks
Those checks are already covered by the "types" in the opcodes, so
remove them.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Mon, 29 Jul 2013 09:38:15 +0000 (11:38 +0200)]
Enable pylint and PEP8 for test support code
The test support code is mainly written from scratch, so in order to
ensure to keep the code quality high, enable pylint and PEP8 checks
for it.
Due to some specialities of the test code, a dedicate pylintrc-test file
is created which configures pylint for test code.
Those differences include:
- lowercase functions are allowed if the first word is test, assert or
main
- lowercase methods are allowed if the first word(s) is test, assert,
runTests, setUp or tearDown
- R0201 (method could be a function) is disabled
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 23 Jul 2013 12:03:02 +0000 (14:03 +0200)]
Initial version of cmdlib test framework
The initial version of the cmdlib test framework is able to execute LU's
with the following components mocked:
* Configuration
* IAllocator interface
* Lock manager
* MCPU processor
* RPC runner
A base test class is provided which makes it easy to execute opcodes and
to perform asserts on the output.
Tests for the LUTestDelay logical unit demonstrate the functionality of
the test framework.
The framework is not yet fully complete, further work will be done as
the tests are written.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 23 Jul 2013 11:59:03 +0000 (13:59 +0200)]
Install python mock using easy_install in chroot
We require a newer mock library, so install it using easy_install in
chroot.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 23 Jul 2013 12:00:39 +0000 (14:00 +0200)]
Require newer python mock library
Older Python mock libraries do not provide MagicMock, which eases
mocking of complex objects quite a bit. As this is a build/test
dependency only, requiring a new version is OK (it's available via
easy_install).
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Fri, 19 Jul 2013 07:00:24 +0000 (09:00 +0200)]
Remove Python < 2.6 compatibility code
This code was used for Python versions < 2.6 which we don't support any
more.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Wed, 7 Aug 2013 15:02:52 +0000 (17:02 +0200)]
Merge branch 'stable-2.9'
* stable-2.9
Fix batch creation of instances
Fix documentation of gnt-instance batch-create
Support multi instance allocs without iallocator
Support DSA SSH keys in bootstrap
Include VCS version in `gnt-cluster version`
Document 'viridian' hypervisor parameter
Support 'viridian' parameter in Xen HVM
Fix formatting of instance names in config verify
Document --no-conflicts-check for gnt-network
Fix verify config if a node has no instances
Version bump for 2.8.0 rc1
Add Make to the list of dependencies
Check for luxid permission during verify config
Add monitoring-query-format.rst to $(docinput)
Fix documentation building rules
Check disk template in right dict when copying
Check disk template in right dict when copying
ganeti.backend_unittest: chmod restricted cmd dir
Fix formatting of tuple in error message
Mark the UUID design doc as implemented
Clarify that cmdlib/ must be removed downgrading
Fix formatting error in the UPGRADE document
Make build_chroot compatible with Squeeze
Update security doc and NEWS for luxid
Add --cleanup to instance failover manpage
Update NEWS with failover cleanup
Add cleanup parameter to instance failover
Fix 'prcre' typo in INSTALL
Update NEWS file for 2.8 wrt vnet_hdr KVM hvparam
Document the vnet_hdr HV parameter for KVM
Format gnt-network info group output
Add 2.7.2 NEWS entry
Typos in ganeti-os-interface.rst
Use exact option name --enabled-disk-templates consistently
Update NEWS file wrt shared file storage
Update manpage of gnt-cluster wrt shared file storage
QA: skip lvm-based tests if lvm disabled
QA: test for --{shared,}-file-storage-dir
gnt-cluster verify: consider shared file storage
gnt-cluster modify --shared-file-storage-dir
Remove obsolete autoconf variable from remaining files
objects.py: remove fallback to autoconf
Cluster-merge: determine shared file storage use from config
Opcodes: remove obsolete RequireSharedFileStorage function
Bootstrap: factor out and prepare shared-file-storage
Move default shared file storage directory to pathutils
Prepare NEWS for 2.8.0 beta2
Add Ganeti 2.9 design document
Update NEWS for version 2.9
Fix the downgrade function of cfgupgrade
Increase maximum HTTP message size
Clarify hbal man page
Properly add the UUID to all the disks
Conflicts:
lib/cmdlib/instance.py
lib/opcodes.py
src/Ganeti/OpCodes.hs
All trivially resolved.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Wed, 7 Aug 2013 11:21:55 +0000 (13:21 +0200)]
Merge branch 'stable-2.8' into stable-2.9
* stable-2.8
Fix batch creation of instances
Fix documentation of gnt-instance batch-create
Support multi instance allocs without iallocator
Support DSA SSH keys in bootstrap
Include VCS version in `gnt-cluster version`
Document 'viridian' hypervisor parameter
Support 'viridian' parameter in Xen HVM
Document --no-conflicts-check for gnt-network
Version bump for 2.8.0 rc1
Add Make to the list of dependencies
Check for luxid permission during verify config
Add monitoring-query-format.rst to $(docinput)
Fix documentation building rules
Check disk template in right dict when copying
Check disk template in right dict when copying
ganeti.backend_unittest: chmod restricted cmd dir
Fix formatting of tuple in error message
Mark the UUID design doc as implemented
Clarify that cmdlib/ must be removed downgrading
Fix formatting error in the UPGRADE document
Make build_chroot compatible with Squeeze
Update security doc and NEWS for luxid
Add --cleanup to instance failover manpage
Update NEWS with failover cleanup
Add cleanup parameter to instance failover
Fix 'prcre' typo in INSTALL
Update NEWS file for 2.8 wrt vnet_hdr KVM hvparam
Document the vnet_hdr HV parameter for KVM
Format gnt-network info group output
Add 2.7.2 NEWS entry
Prepare NEWS for 2.8.0 beta2
Fix the downgrade function of cfgupgrade
Increase maximum HTTP message size
Clarify hbal man page
Properly add the UUID to all the disks
Conflicts:
NEWS
configure.ac
doc/design-draft.rst
doc/index.rst
lib/cmdlib/instance.py
lib/cmdlib/instance_migration.py
lib/constants.py
lib/hypervisor/hv_xen.py
man/gnt-instance.rst
man/gnt-network.rst
test/hs/Test/Ganeti/OpCodes.hs
tools/cfgupgrade
All trivially merged.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 7 Aug 2013 09:43:44 +0000 (11:43 +0200)]
Merge branch 'stable-2.7' into stable-2.8
* stable-2.7
Fix documentation of gnt-instance batch-create
Support multi instance allocs without iallocator
Document --no-conflicts-check for gnt-network
Check disk template in right dict when copying
ganeti.backend_unittest: chmod restricted cmd dir
Fix formatting of tuple in error message
Fix 'prcre' typo in INSTALL
Format gnt-network info group output
Add 2.7.2 NEWS entry
Conflicts:
INSTALL
(trivial)
NEWS
(added entry to unreleased 2.8 section with remark that it was
merged from 2.7)
lib/cmdlib.py
(followed cmdlib split)
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 5 Aug 2013 09:06:13 +0000 (11:06 +0200)]
Fix batch creation of instances
During batch creation of instances the 'reason' field in opcodes is set
to None (but the field is present). This caused problems when adding a
reasons to the reason trail.
Setting the default value for the 'reason' field to the empty list fixes
this issue.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Mon, 5 Aug 2013 10:50:37 +0000 (12:50 +0200)]
Fix documentation of gnt-instance batch-create
The documentation of gnt-instance batch-create was outdated and
contained invalid examples. This patch corrects the man page and
includes working example inputs.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Mon, 5 Aug 2013 10:11:21 +0000 (12:11 +0200)]
Support multi instance allocs without iallocator
If all instances in the multi allocation request have already their
primary and secondary node set, there is no need for an iallocator. Thus
don't require it in this case and omit the call to it all together.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Jose A. Lopes [Fri, 2 Aug 2013 12:53:55 +0000 (14:53 +0200)]
Update parameter variables
Because opcodes are generated, parameter variables no longer
exist. This patch fixes the Python opcode tests not to refer to these
variables.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Fri, 2 Aug 2013 12:50:24 +0000 (14:50 +0200)]
Remove test for mutable default parameter values
Opcode parameters contain default values which can be, for example, a
list, dict, or set. Because these values are mutable, 'Validate'
performs a deepcopy before constructing the opcode dict and,
therefore, changing these values will not affect the default value
stored in the opcode description. As a result, the default value can
be reused in several calls to 'Validate' without a problem. The test
to ensure immutable default values can thus be removed.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Fri, 2 Aug 2013 12:48:50 +0000 (14:48 +0200)]
Remove Python opcode test 'TestClusterOsList'
Python opcode generation produces also calls to Python type predicates
in a more composable way compared to the previous hand-written type
predicates. As a result, some predicates, such as,
'TestClusterOsList', became unused because they are achieved through a
combination of other predicates.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Mon, 5 Aug 2013 09:17:40 +0000 (11:17 +0200)]
Remove "missing result" check in opcode tests
Some opcodes used 'None', others used 'ht.TNone', as a way to
represent the absence of a return type. This no longer applies,
therefore, this patch updates the corresponding Python tests.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Fri, 2 Aug 2013 12:29:01 +0000 (14:29 +0200)]
Remove Python type predicate 'NoType'
Type predicate 'NoType' is no longer necessary.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Tue, 30 Jul 2013 14:18:22 +0000 (16:18 +0200)]
Update .gitignore with opcode generated files
Python opcode generation produces 'opcodes.py' and there is also the
program 'hs2py' which must go in .gitignore.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Mon, 5 Aug 2013 12:09:53 +0000 (14:09 +0200)]
Hook h2spy in Makefile.am
* add rules to Makefile.am to use hs2py to generate the Python opcodes
from Haskell and update tests to check that Haskell and Python contain
the same opcodes.
* split 'opcodes.py' in 'opcodes.py.in_after' and 'opcodes_base.py',
moving as much code as possible to 'opcodes_base.py' without
creating a circular dependency
* update reference in the remaining Python modules
* remove lib/opcodes.py dependency from documentation target in order
to prevent recompilation of documentation in the distributed source
tarball, in particular because 'sphinx-build' is an optional
dependency (issue 547)
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Thu, 1 Aug 2013 12:35:16 +0000 (14:35 +0200)]
Add hs2py program that generates Python opcodes
Add hs2py which is a Haskell program that uses the 'Hs2Py' module to
output the actual Python opcode strings.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Thu, 1 Aug 2013 12:32:13 +0000 (14:32 +0200)]
Generate Python opcodes from opcode descriptors
Add Haskell module Hs2Py which contains the helper functions that
generate the Python opcodes as strings from the Haskell opcode
descriptors produced by Template Haskell.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Thu, 1 Aug 2013 13:42:19 +0000 (15:42 +0200)]
Remove TagType
By removing 'TagObject' in the previous patch, 'TagType' also became
useless, since it was only used by 'TagObject'. This patch removes 'TagType'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>