1*eeba3d73SThomas Huth#!/usr/bin/env python3
2*eeba3d73SThomas Huth#
3*eeba3d73SThomas Huth# Version check example test
4*eeba3d73SThomas Huth#
5*eeba3d73SThomas Huth# Copyright (c) 2018 Red Hat, Inc.
6*eeba3d73SThomas Huth#
7*eeba3d73SThomas Huth# Author:
8*eeba3d73SThomas Huth#  Cleber Rosa <crosa@redhat.com>
9*eeba3d73SThomas Huth#
10*eeba3d73SThomas Huth# This work is licensed under the terms of the GNU GPL, version 2 or
11*eeba3d73SThomas Huth# later.  See the COPYING file in the top-level directory.
12*eeba3d73SThomas Huth
13*eeba3d73SThomas Huth
14*eeba3d73SThomas Huthfrom qemu_test import QemuSystemTest
15*eeba3d73SThomas Huth
16*eeba3d73SThomas Huth
17*eeba3d73SThomas Huthclass Version(QemuSystemTest):
18*eeba3d73SThomas Huth
19*eeba3d73SThomas Huth    def test_qmp_human_info_version(self):
20*eeba3d73SThomas Huth        self.set_machine('none')
21*eeba3d73SThomas Huth        self.vm.add_args('-nodefaults')
22*eeba3d73SThomas Huth        self.vm.launch()
23*eeba3d73SThomas Huth        res = self.vm.cmd('human-monitor-command',
24*eeba3d73SThomas Huth                          command_line='info version')
25*eeba3d73SThomas Huth        self.assertRegex(res, r'^(\d+\.\d+\.\d)')
26*eeba3d73SThomas Huth
27*eeba3d73SThomas Huthif __name__ == '__main__':
28*eeba3d73SThomas Huth    QemuSystemTest.main()
29