Bump?

On Tue, Aug 27, 2013 at 5:05 PM, Thomas Thrainer <[email protected]>wrote:

> This patch provides rudimentary unit test coverage for LUInstanceQuery
> and LUInstanceQueryData.
>
> Signed-off-by: Thomas Thrainer <[email protected]>
> ---
>  Makefile.am                               |  1 +
>  test/py/cmdlib/instance_query_unittest.py | 68
> +++++++++++++++++++++++++++++++
>  2 files changed, 69 insertions(+)
>  create mode 100644 test/py/cmdlib/instance_query_unittest.py
>
> diff --git a/Makefile.am b/Makefile.am
> index fbfce69..4837770 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1280,6 +1280,7 @@ python_tests = \
>         test/py/cmdlib/group_unittest.py \
>         test/py/cmdlib/instance_unittest.py \
>         test/py/cmdlib/instance_migration_unittest.py \
> +       test/py/cmdlib/instance_query_unittest.py \
>         test/py/cmdlib/instance_storage_unittest.py \
>         test/py/cmdlib/test_unittest.py \
>         test/py/cfgupgrade_unittest.py \
> diff --git a/test/py/cmdlib/instance_query_unittest.py
> b/test/py/cmdlib/instance_query_unittest.py
> new file mode 100644
> index 0000000..68b651d
> --- /dev/null
> +++ b/test/py/cmdlib/instance_query_unittest.py
> @@ -0,0 +1,68 @@
> +#!/usr/bin/python
> +#
> +
> +# Copyright (C) 2013 Google Inc.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +# 02110-1301, USA.
> +
> +
> +"""Tests for LUInstanceFailover and LUInstanceMigrate
> +
> +"""
> +
> +from ganeti import opcodes
> +from ganeti import query
> +
> +from testsupport import *
> +
> +import testutils
> +
> +
> +class TestLUInstanceQuery(CmdlibTestCase):
> +  def setUp(self):
> +    super(TestLUInstanceQuery, self).setUp()
> +
> +    self.inst = self.cfg.AddNewInstance()
> +    self.fields = query._BuildInstanceFields().keys()
> +
> +  def testInvalidInstance(self):
> +    op = opcodes.OpInstanceQuery(names=["does_not_exist"],
> +                                 output_fields=self.fields)
> +    self.ExecOpCodeExpectOpPrereqError(
> +      op, "Instance 'does_not_exist' not known")
> +
> +  def testQueryInstance(self):
> +    op = opcodes.OpInstanceQuery(output_fields=self.fields)
> +    self.ExecOpCode(op)
> +
> +
> +class TestLUInstanceQueryData(CmdlibTestCase):
> +  def setUp(self):
> +    super(TestLUInstanceQueryData, self).setUp()
> +
> +    self.inst = self.cfg.AddNewInstance()
> +
> +  def testQueryInstanceData(self):
> +    op = opcodes.OpInstanceQueryData()
> +    self.ExecOpCode(op)
> +
> +  def testQueryStaticInstanceData(self):
> +    op = opcodes.OpInstanceQueryData(static=True)
> +    self.ExecOpCode(op)
> +
> +
> +if __name__ == "__main__":
> +  testutils.GanetiTestProgram()
> --
> 1.8.3.1
>
>


-- 
Thomas Thrainer | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to