tests/: spelling fixes
with some rewording in tests/qemu-iotests/298 tests/qtest/fuzz/generic_fuzz.c tests/unit/test-throttle.c as suggested by Eric. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
d30b5bc95a
commit
96420a30e0
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# group: rw quick
|
# group: rw quick
|
||||||
# Exercize QEMU generated ACPI/SMBIOS tables using biosbits,
|
# Exercise QEMU generated ACPI/SMBIOS tables using biosbits,
|
||||||
# https://biosbits.org/
|
# https://biosbits.org/
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@ -366,7 +366,7 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
|
|||||||
super().tearDown()
|
super().tearDown()
|
||||||
|
|
||||||
def test_acpi_smbios_bits(self):
|
def test_acpi_smbios_bits(self):
|
||||||
"""The main test case implementaion."""
|
"""The main test case implementation."""
|
||||||
|
|
||||||
iso_file = os.path.join(self._workDir,
|
iso_file = os.path.join(self._workDir,
|
||||||
'bits-%d.iso' %self._bitsInternalVer)
|
'bits-%d.iso' %self._bitsInternalVer)
|
||||||
|
@ -273,8 +273,8 @@ def test_rsdp():
|
|||||||
|
|
||||||
# Checksum the first 20 bytes per ACPI 1.0
|
# Checksum the first 20 bytes per ACPI 1.0
|
||||||
csum = sum(ord(c) for c in data[:20]) % 0x100
|
csum = sum(ord(c) for c in data[:20]) % 0x100
|
||||||
testsuite.test('ACPI 1.0 table first 20 bytes cummulative checksum must equal 0', csum == 0)
|
testsuite.test('ACPI 1.0 table first 20 bytes cumulative checksum must equal 0', csum == 0)
|
||||||
testsuite.print_detail("Cummulative checksum = {} (Expected 0)".format(csum))
|
testsuite.print_detail("Cumulative checksum = {} (Expected 0)".format(csum))
|
||||||
|
|
||||||
test_table_checksum(data)
|
test_table_checksum(data)
|
||||||
rsdp = acpi.parse_rsdp()
|
rsdp = acpi.parse_rsdp()
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
{
|
{
|
||||||
top 00000000 00000000 00000000 00000000
|
top 00000000 00000000 00000000 00000000
|
||||||
sub1 00000000 00000000 00000000 ........ %sub1
|
sub1 00000000 00000000 00000000 ........ %sub1
|
||||||
# comments are suposed to be indented
|
# comments are supposed to be indented
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# the top-level directory.
|
# the top-level directory.
|
||||||
|
|
||||||
# This might be set by ENV of a docker container... it is always
|
# This might be set by ENV of a docker container... it is always
|
||||||
# overriden by TARGET_LIST if the user sets it. We special case
|
# overridden by TARGET_LIST if the user sets it. We special case
|
||||||
# "none" to allow for other options like --disable-tcg to restrict the
|
# "none" to allow for other options like --disable-tcg to restrict the
|
||||||
# builds we eventually do.
|
# builds we eventually do.
|
||||||
if test "$DEF_TARGET_LIST" = "none"; then
|
if test "$DEF_TARGET_LIST" = "none"; then
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Migration test batch comparison invokation
|
# Migration test batch comparison invocation
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Red Hat, Inc.
|
# Copyright (c) 2016 Red Hat, Inc.
|
||||||
#
|
#
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Migration test direct invokation command
|
# Migration test direct invocation command
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 Red Hat, Inc.
|
# Copyright (c) 2016 Red Hat, Inc.
|
||||||
#
|
#
|
||||||
|
@ -98,7 +98,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
|
|||||||
} else if (g_strcmp0(tokens[1], "rw") == 0) {
|
} else if (g_strcmp0(tokens[1], "rw") == 0) {
|
||||||
rw = QEMU_PLUGIN_MEM_RW;
|
rw = QEMU_PLUGIN_MEM_RW;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "invaild value for argument track: %s\n", opt);
|
fprintf(stderr, "invalid value for argument track: %s\n", opt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else if (g_strcmp0(tokens[0], "inline") == 0) {
|
} else if (g_strcmp0(tokens[0], "inline") == 0) {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# check 'if not' with empy argument
|
# check 'if not' with empty argument
|
||||||
{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' },
|
{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' },
|
||||||
'if': { 'not': '' } }
|
'if': { 'not': '' } }
|
||||||
|
@ -39,7 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
|||||||
. ./common.filter
|
. ./common.filter
|
||||||
. ./common.pattern
|
. ./common.pattern
|
||||||
|
|
||||||
# Any format supporting intenal snapshots
|
# Any format supporting internal snapshots
|
||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
_supported_proto generic
|
_supported_proto generic
|
||||||
# Internal snapshots are (currently) impossible with refcount_bits=1,
|
# Internal snapshots are (currently) impossible with refcount_bits=1,
|
||||||
|
@ -845,7 +845,7 @@ class TestCommitWithFilters(iotests.QMPTestCase):
|
|||||||
self.assertIsNone(self.vm.node_info('cow-2'))
|
self.assertIsNone(self.vm.node_info('cow-2'))
|
||||||
self.assertIsNotNone(self.vm.node_info('cow-1'))
|
self.assertIsNotNone(self.vm.node_info('cow-1'))
|
||||||
|
|
||||||
# 2 has been comitted into 1
|
# 2 has been committed into 1
|
||||||
self.pattern_files[2] = self.img1
|
self.pattern_files[2] = self.img1
|
||||||
|
|
||||||
def test_commit_through_filter(self):
|
def test_commit_through_filter(self):
|
||||||
@ -863,7 +863,7 @@ class TestCommitWithFilters(iotests.QMPTestCase):
|
|||||||
self.assertIsNone(self.vm.node_info('bottom-filter'))
|
self.assertIsNone(self.vm.node_info('bottom-filter'))
|
||||||
self.assertIsNotNone(self.vm.node_info('cow-0'))
|
self.assertIsNotNone(self.vm.node_info('cow-0'))
|
||||||
|
|
||||||
# 1 has been comitted into 0
|
# 1 has been committed into 0
|
||||||
self.pattern_files[1] = self.img0
|
self.pattern_files[1] = self.img0
|
||||||
|
|
||||||
def test_filtered_active_commit_with_filter(self):
|
def test_filtered_active_commit_with_filter(self):
|
||||||
@ -900,7 +900,7 @@ class TestCommitWithFilters(iotests.QMPTestCase):
|
|||||||
drv0 = next(dev for dev in blockdevs if dev['qdev'] == 'drv0')
|
drv0 = next(dev for dev in blockdevs if dev['qdev'] == 'drv0')
|
||||||
self.assertEqual(drv0['inserted']['node-name'], 'cow-2')
|
self.assertEqual(drv0['inserted']['node-name'], 'cow-2')
|
||||||
|
|
||||||
# 3 has been comitted into 2
|
# 3 has been committed into 2
|
||||||
self.pattern_files[3] = self.img2
|
self.pattern_files[3] = self.img2
|
||||||
|
|
||||||
def test_filtered_active_commit_without_filter(self):
|
def test_filtered_active_commit_without_filter(self):
|
||||||
@ -916,7 +916,7 @@ class TestCommitWithFilters(iotests.QMPTestCase):
|
|||||||
self.assertIsNone(self.vm.node_info('cow-3'))
|
self.assertIsNone(self.vm.node_info('cow-3'))
|
||||||
self.assertIsNotNone(self.vm.node_info('cow-2'))
|
self.assertIsNotNone(self.vm.node_info('cow-2'))
|
||||||
|
|
||||||
# 3 has been comitted into 2
|
# 3 has been committed into 2
|
||||||
self.pattern_files[3] = self.img2
|
self.pattern_files[3] = self.img2
|
||||||
|
|
||||||
class TestCommitWithOverriddenBacking(iotests.QMPTestCase):
|
class TestCommitWithOverriddenBacking(iotests.QMPTestCase):
|
||||||
|
@ -125,7 +125,7 @@ aio_flush
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Sequential write, but the next cluster is already allocated
|
# Sequential write, but the next cluster is already allocated
|
||||||
# and phyiscally in the right position
|
# and physically in the right position
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
write -P 89 0x80000 0x1000
|
write -P 89 0x80000 0x1000
|
||||||
write -P 90 0x96000 0x8000
|
write -P 90 0x96000 0x8000
|
||||||
|
@ -182,7 +182,7 @@ done
|
|||||||
echo
|
echo
|
||||||
echo "=== Testing afl image with a very large capacity ==="
|
echo "=== Testing afl image with a very large capacity ==="
|
||||||
_use_sample_img afl9.vmdk.bz2
|
_use_sample_img afl9.vmdk.bz2
|
||||||
_img_info | grep -q 'Cannot allocate memory' && _notrun "Insufficent memory, skipped test"
|
_img_info | grep -q 'Cannot allocate memory' && _notrun "Insufficient memory, skipped test"
|
||||||
_img_info
|
_img_info
|
||||||
_cleanup_test_img
|
_cleanup_test_img
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ _supported_os Linux
|
|||||||
# we have explicit tests for various cluster sizes, the remaining tests
|
# we have explicit tests for various cluster sizes, the remaining tests
|
||||||
# require the default 64k cluster
|
# require the default 64k cluster
|
||||||
# we don't have explicit tests for zstd qcow2 compression type, as zstd may be
|
# we don't have explicit tests for zstd qcow2 compression type, as zstd may be
|
||||||
# not compiled in. And we can't create compat images with comression type
|
# not compiled in. And we can't create compat images with compression type
|
||||||
# extension
|
# extension
|
||||||
_unsupported_imgopts 'refcount_bits=\([^1]\|.\([^6]\|$\)\)' data_file \
|
_unsupported_imgopts 'refcount_bits=\([^1]\|.\([^6]\|$\)\)' data_file \
|
||||||
cluster_size compression_type
|
cluster_size compression_type
|
||||||
|
@ -41,7 +41,7 @@ _supported_fmt qcow2
|
|||||||
_supported_proto file fuse
|
_supported_proto file fuse
|
||||||
_require_drivers blkdebug blkverify
|
_require_drivers blkdebug blkverify
|
||||||
# blkdebug can only inject errors on bs->file, not on the data_file,
|
# blkdebug can only inject errors on bs->file, not on the data_file,
|
||||||
# so thie test does not work with external data files
|
# so this test does not work with external data files
|
||||||
_unsupported_imgopts data_file
|
_unsupported_imgopts data_file
|
||||||
|
|
||||||
do_run_qemu()
|
do_run_qemu()
|
||||||
|
@ -93,7 +93,7 @@ output=$($QEMU_IO -f qcow2 -C -c "read -P 0 1k $((2*1024*1024*1024 - 512))" \
|
|||||||
"$TEST_WRAP" 2>&1 | _filter_qemu_io)
|
"$TEST_WRAP" 2>&1 | _filter_qemu_io)
|
||||||
case $output in
|
case $output in
|
||||||
*allocate*)
|
*allocate*)
|
||||||
_notrun "Insufficent memory to run test" ;;
|
_notrun "Insufficient memory to run test" ;;
|
||||||
*) printf '%s\n' "$output" ;;
|
*) printf '%s\n' "$output" ;;
|
||||||
esac
|
esac
|
||||||
$QEMU_IO -f qcow2 -C -c "read -P 0 $((3*1024*1024*1024 + 1024)) 1k" \
|
$QEMU_IO -f qcow2 -C -c "read -P 0 $((3*1024*1024*1024 + 1024)) 1k" \
|
||||||
|
@ -95,7 +95,7 @@ output=$($QEMU_IO \
|
|||||||
2>&1 | _filter_qemu_io)
|
2>&1 | _filter_qemu_io)
|
||||||
case $output in
|
case $output in
|
||||||
*allocate*)
|
*allocate*)
|
||||||
_notrun "Insufficent memory to run test" ;;
|
_notrun "Insufficient memory to run test" ;;
|
||||||
*) printf '%s\n' "$output" ;;
|
*) printf '%s\n' "$output" ;;
|
||||||
esac
|
esac
|
||||||
$QEMU_IO \
|
$QEMU_IO \
|
||||||
|
@ -140,8 +140,8 @@ class TestTruncate(iotests.QMPTestCase):
|
|||||||
stat = os.stat(disk)
|
stat = os.stat(disk)
|
||||||
refstat = os.stat(refdisk)
|
refstat = os.stat(refdisk)
|
||||||
|
|
||||||
# Probably we'll want preallocate filter to keep align to cluster when
|
# The preallocate filter may keep cluster alignment when shrinking,
|
||||||
# shrink preallocation, so, ignore small differece
|
# so ignore small differences
|
||||||
self.assertLess(abs(stat.st_size - refstat.st_size), 64 * 1024)
|
self.assertLess(abs(stat.st_size - refstat.st_size), 64 * 1024)
|
||||||
|
|
||||||
# Preallocate filter may leak some internal clusters (for example, if
|
# Preallocate filter may leak some internal clusters (for example, if
|
||||||
|
@ -19,7 +19,7 @@ disable=invalid-name,
|
|||||||
too-many-public-methods,
|
too-many-public-methods,
|
||||||
# pylint warns about Optional[] etc. as unsubscriptable in 3.9
|
# pylint warns about Optional[] etc. as unsubscriptable in 3.9
|
||||||
unsubscriptable-object,
|
unsubscriptable-object,
|
||||||
# pylint's static analysis causes false positivies for file_path();
|
# pylint's static analysis causes false positives for file_path();
|
||||||
# If we really care to make it statically knowable, we'll use mypy.
|
# If we really care to make it statically knowable, we'll use mypy.
|
||||||
unbalanced-tuple-unpacking,
|
unbalanced-tuple-unpacking,
|
||||||
# Sometimes we need to disable a newly introduced pylint warning.
|
# Sometimes we need to disable a newly introduced pylint warning.
|
||||||
|
@ -330,7 +330,7 @@ static void ahci_test_pci_spec(AHCIQState *ahci)
|
|||||||
ASSERT_BIT_CLEAR(datal, ~0xFF);
|
ASSERT_BIT_CLEAR(datal, ~0xFF);
|
||||||
g_assert_cmphex(datal, !=, 0);
|
g_assert_cmphex(datal, !=, 0);
|
||||||
|
|
||||||
/* Check specification adherence for capability extenstions. */
|
/* Check specification adherence for capability extensions. */
|
||||||
data = qpci_config_readw(ahci->dev, datal);
|
data = qpci_config_readw(ahci->dev, datal);
|
||||||
|
|
||||||
switch (ahci->fingerprint) {
|
switch (ahci->fingerprint) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#define BCM2708_DMA_INT_STATUS 0xfe0
|
#define BCM2708_DMA_INT_STATUS 0xfe0
|
||||||
|
|
||||||
/* DMA Trasfer Info fields: */
|
/* DMA Transfer Info fields: */
|
||||||
#define BCM2708_DMA_INT_EN (1 << 0)
|
#define BCM2708_DMA_INT_EN (1 << 0)
|
||||||
#define BCM2708_DMA_D_INC (1 << 4)
|
#define BCM2708_DMA_D_INC (1 << 4)
|
||||||
#define BCM2708_DMA_S_INC (1 << 8)
|
#define BCM2708_DMA_S_INC (1 << 8)
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* 4. Run
|
* 4. Run
|
||||||
* make check V=2
|
* make check V=2
|
||||||
* this will produce a bunch of warnings about differences
|
* this will produce a bunch of warnings about differences
|
||||||
* beween actual and expected ACPI tables. If you have IASL installed,
|
* between actual and expected ACPI tables. If you have IASL installed,
|
||||||
* they will also be disassembled so you can look at the disassembled
|
* they will also be disassembled so you can look at the disassembled
|
||||||
* output. If not - disassemble them yourself in any way you like.
|
* output. If not - disassemble them yourself in any way you like.
|
||||||
* Look at the differences - make sure they make sense and match what the
|
* Look at the differences - make sure they make sense and match what the
|
||||||
|
@ -38,7 +38,7 @@ static void send_and_receive(void *obj, void *data, QGuestAllocator *alloc)
|
|||||||
|
|
||||||
i2c_read_block(i2cdev, 0, resp, sizeof(resp));
|
i2c_read_block(i2cdev, 0, resp, sizeof(resp));
|
||||||
|
|
||||||
/* check retrieved time againt local time */
|
/* check retrieved time against local time */
|
||||||
g_assert_cmpuint(bcd2bin(resp[4]), == , tm_ptr->tm_mday);
|
g_assert_cmpuint(bcd2bin(resp[4]), == , tm_ptr->tm_mday);
|
||||||
g_assert_cmpuint(bcd2bin(resp[5]), == , 1 + tm_ptr->tm_mon);
|
g_assert_cmpuint(bcd2bin(resp[5]), == , 1 + tm_ptr->tm_mon);
|
||||||
g_assert_cmpuint(2000 + bcd2bin(resp[6]), == , 1900 + tm_ptr->tm_year);
|
g_assert_cmpuint(2000 + bcd2bin(resp[6]), == , 1900 + tm_ptr->tm_year);
|
||||||
|
@ -846,9 +846,9 @@ static void generic_pre_fuzz(QTestState *s)
|
|||||||
* functionality B
|
* functionality B
|
||||||
*
|
*
|
||||||
* This function attempts to produce an input that:
|
* This function attempts to produce an input that:
|
||||||
* Ouptut: maps a device's BARs, set up three DMA patterns, triggers
|
* Output: maps a device's BARs, set up three DMA patterns, triggers
|
||||||
* functionality A device, replaces the DMA patterns with a single
|
* device functionality A, replaces the DMA patterns with a single
|
||||||
* patten, and triggers device functionality B.
|
* pattern, and triggers device functionality B.
|
||||||
*/
|
*/
|
||||||
static size_t generic_fuzz_crossover(const uint8_t *data1, size_t size1, const
|
static size_t generic_fuzz_crossover(const uint8_t *data1, size_t size1, const
|
||||||
uint8_t *data2, size_t size2, uint8_t *out,
|
uint8_t *data2, size_t size2, uint8_t *out,
|
||||||
|
@ -54,7 +54,7 @@ struct QOSStackElement {
|
|||||||
int length;
|
int length;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Each enty in these hash table will consist of <string, node/edge> pair. */
|
/* Each entry in these hash table will consist of <string, node/edge> pair. */
|
||||||
static GHashTable *edge_table;
|
static GHashTable *edge_table;
|
||||||
static GHashTable *node_table;
|
static GHashTable *node_table;
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ static QOSGraphEdge *search_list_edges(QOSGraphEdgeList *edgelist,
|
|||||||
/**
|
/**
|
||||||
* search_machine(): search for a machine @name in the node hash
|
* search_machine(): search for a machine @name in the node hash
|
||||||
* table. A machine is the child of the root node.
|
* table. A machine is the child of the root node.
|
||||||
* This function forces the research in the childs of the root,
|
* This function forces the research in the children of the root,
|
||||||
* to check the node is a proper machine
|
* to check the node is a proper machine
|
||||||
*
|
*
|
||||||
* Returns: on success: the %QOSGraphNode
|
* Returns: on success: the %QOSGraphNode
|
||||||
|
@ -197,7 +197,7 @@ char *qos_graph_edge_get_name(QOSGraphEdge *edge);
|
|||||||
* qos_graph_get_machine(): returns the machine assigned
|
* qos_graph_get_machine(): returns the machine assigned
|
||||||
* to that @node name.
|
* to that @node name.
|
||||||
*
|
*
|
||||||
* It performs a search only trough the list of machines
|
* It performs a search only through the list of machines
|
||||||
* (i.e. the QOS_ROOT child).
|
* (i.e. the QOS_ROOT child).
|
||||||
*
|
*
|
||||||
* Returns: on success: the %QOSGraphNode
|
* Returns: on success: the %QOSGraphNode
|
||||||
|
@ -28,7 +28,7 @@ static void virtio_gpio_cleanup(QVhostUserGPIO *gpio)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This handles the VirtIO setup from the point of view of the driver
|
* This handles the VirtIO setup from the point of view of the driver
|
||||||
* frontend and therefor doesn't present any vhost specific features
|
* frontend and therefore doesn't present any vhost specific features
|
||||||
* and in fact masks of the re-used bit.
|
* and in fact masks of the re-used bit.
|
||||||
*/
|
*/
|
||||||
static void virtio_gpio_setup(QVhostUserGPIO *gpio)
|
static void virtio_gpio_setup(QVhostUserGPIO *gpio)
|
||||||
|
@ -112,7 +112,7 @@ static int socket_accept(int sock)
|
|||||||
socklen_t addrlen;
|
socklen_t addrlen;
|
||||||
int ret;
|
int ret;
|
||||||
/*
|
/*
|
||||||
* timeout unit of blocking receive calls is different among platfoms.
|
* timeout unit of blocking receive calls is different among platforms.
|
||||||
* It's in seconds on non-Windows platforms but milliseconds on Windows.
|
* It's in seconds on non-Windows platforms but milliseconds on Windows.
|
||||||
*/
|
*/
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
@ -1697,7 +1697,7 @@ QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch,
|
|||||||
|
|
||||||
qtest_client_set_rx_handler(qts, qtest_client_inproc_recv_line);
|
qtest_client_set_rx_handler(qts, qtest_client_inproc_recv_line);
|
||||||
|
|
||||||
/* send() may not have a matching protoype, so use a type-safe wrapper */
|
/* send() may not have a matching prototype, so use a type-safe wrapper */
|
||||||
qts->ops.external_send = send;
|
qts->ops.external_send = send;
|
||||||
qtest_client_set_tx_handler(qts, send_wrapper);
|
qtest_client_set_tx_handler(qts, send_wrapper);
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ static void migrate_ensure_converge(QTestState *who)
|
|||||||
* transferred.
|
* transferred.
|
||||||
*
|
*
|
||||||
* Finally we go back to the source and read a byte just
|
* Finally we go back to the source and read a byte just
|
||||||
* before the marker untill we see it flip in value. This
|
* before the marker until we see it flip in value. This
|
||||||
* is proof that start_address -> MAGIC_OFFSET_BASE
|
* is proof that start_address -> MAGIC_OFFSET_BASE
|
||||||
* is now dirty again.
|
* is now dirty again.
|
||||||
*
|
*
|
||||||
@ -826,7 +826,7 @@ static int test_migrate_start(QTestState **from, QTestState **to,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove shmem file immediately to avoid memory leak in test failed case.
|
* Remove shmem file immediately to avoid memory leak in test failed case.
|
||||||
* It's valid becase QEMU has already opened this file
|
* It's valid because QEMU has already opened this file
|
||||||
*/
|
*/
|
||||||
if (args->use_shmem) {
|
if (args->use_shmem) {
|
||||||
unlink(shmem_path);
|
unlink(shmem_path);
|
||||||
@ -2103,7 +2103,7 @@ static void test_migrate_auto_converge(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We want the test to be stable and as fast as possible.
|
* We want the test to be stable and as fast as possible.
|
||||||
* E.g., with 1Gb/s bandwith migration may pass without throttling,
|
* E.g., with 1Gb/s bandwidth migration may pass without throttling,
|
||||||
* so we need to decrease a bandwidth.
|
* so we need to decrease a bandwidth.
|
||||||
*/
|
*/
|
||||||
const int64_t init_pct = 5, inc_pct = 25, max_pct = 95;
|
const int64_t init_pct = 5, inc_pct = 25, max_pct = 95;
|
||||||
|
@ -384,7 +384,7 @@ static void test_pause_resume(gconstpointer test_data)
|
|||||||
g_assert_true(qtest_get_irq(global_qtest, tim_timer_irq(td)));
|
g_assert_true(qtest_get_irq(global_qtest, tim_timer_irq(td)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verifies that the prescaler can be changed while the timer is runnin. */
|
/* Verifies that the prescaler can be changed while the timer is running. */
|
||||||
static void test_prescaler_change(gconstpointer test_data)
|
static void test_prescaler_change(gconstpointer test_data)
|
||||||
{
|
{
|
||||||
const TestData *td = test_data;
|
const TestData *td = test_data;
|
||||||
|
@ -77,7 +77,7 @@ static void *tpm_emu_tpm_thread(void *data)
|
|||||||
s->tpm_msg->code = cpu_to_be32(TPM_FAIL);
|
s->tpm_msg->code = cpu_to_be32(TPM_FAIL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_debug("unsupport TPM version %u", s->tpm_version);
|
g_debug("unsupported TPM version %u", s->tpm_version);
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
qio_channel_write(ioc, (char *)s->tpm_msg, be32_to_cpu(s->tpm_msg->len),
|
qio_channel_write(ioc, (char *)s->tpm_msg, be32_to_cpu(s->tpm_msg->len),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* QTest TPM commont test code
|
* QTest TPM common test code
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018 IBM Corporation
|
* Copyright (c) 2018 IBM Corporation
|
||||||
* Copyright (c) 2018 Red Hat, Inc.
|
* Copyright (c) 2018 Red Hat, Inc.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* QTest TPM commont test code
|
* QTest TPM common test code
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018 IBM Corporation
|
* Copyright (c) 2018 IBM Corporation
|
||||||
*
|
*
|
||||||
|
@ -468,7 +468,7 @@ static void tpm_tis_i2c_test_check_access_reg_release(const void *data)
|
|||||||
TPM_TIS_ACCESS_ACTIVE_LOCALITY);
|
TPM_TIS_ACCESS_ACTIVE_LOCALITY);
|
||||||
/*
|
/*
|
||||||
* highest locality should now be active; release it and make sure the
|
* highest locality should now be active; release it and make sure the
|
||||||
* next higest locality is active afterwards
|
* next highest locality is active afterwards
|
||||||
*/
|
*/
|
||||||
for (l = TPM_TIS_NUM_LOCALITIES - 2; l >= 0; l--) {
|
for (l = TPM_TIS_NUM_LOCALITIES - 2; l >= 0; l--) {
|
||||||
if (l == locty) {
|
if (l == locty) {
|
||||||
|
@ -340,7 +340,7 @@ void tpm_tis_test_check_access_reg_release(const void *data)
|
|||||||
TPM_TIS_ACCESS_ACTIVE_LOCALITY);
|
TPM_TIS_ACCESS_ACTIVE_LOCALITY);
|
||||||
/*
|
/*
|
||||||
* highest locality should now be active; release it and make sure the
|
* highest locality should now be active; release it and make sure the
|
||||||
* next higest locality is active afterwards
|
* next highest locality is active afterwards
|
||||||
*/
|
*/
|
||||||
for (l = TPM_TIS_NUM_LOCALITIES - 2; l >= 0; l--) {
|
for (l = TPM_TIS_NUM_LOCALITIES - 2; l >= 0; l--) {
|
||||||
if (l == locty) {
|
if (l == locty) {
|
||||||
|
@ -961,7 +961,7 @@ static void *vhost_user_blk_test_setup(GString *cmd_line, void *arg)
|
|||||||
* Setup for hotplug.
|
* Setup for hotplug.
|
||||||
*
|
*
|
||||||
* Since vhost-user server only serves one vhost-user client one time,
|
* Since vhost-user server only serves one vhost-user client one time,
|
||||||
* another exprot
|
* another export
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void *vhost_user_blk_hotplug_test_setup(GString *cmd_line, void *arg)
|
static void *vhost_user_blk_hotplug_test_setup(GString *cmd_line, void *arg)
|
||||||
|
@ -212,7 +212,7 @@ static void announce_self(void *obj, void *data, QGuestAllocator *t_alloc)
|
|||||||
g_assert_cmpint(*proto, ==, htons(ETH_P_RARP));
|
g_assert_cmpint(*proto, ==, htons(ETH_P_RARP));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stop the announcment by settings rounds to 0 on the
|
* Stop the announcement by settings rounds to 0 on the
|
||||||
* existing timer.
|
* existing timer.
|
||||||
*/
|
*/
|
||||||
rsp = qmp("{ 'execute' : 'announce-self', "
|
rsp = qmp("{ 'execute' : 'announce-self', "
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#define VGID_GUID "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
|
#define VGID_GUID "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
|
||||||
#define VMGENID_GUID_OFFSET 40 /* allow space for
|
#define VMGENID_GUID_OFFSET 40 /* allow space for
|
||||||
* OVMF SDT Header Probe Supressor
|
* OVMF SDT Header Probe Suppressor
|
||||||
*/
|
*/
|
||||||
#define RSDP_ADDR_INVALID 0x100000 /* RSDP must be below this address */
|
#define RSDP_ADDR_INVALID 0x100000 /* RSDP must be below this address */
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
mutex:aio_context_acquire
|
mutex:aio_context_acquire
|
||||||
mutex:pthread_mutex_lock
|
mutex:pthread_mutex_lock
|
||||||
|
|
||||||
# TSan reports a race betwen pthread_mutex_init() and
|
# TSan reports a race between pthread_mutex_init() and
|
||||||
# pthread_mutex_lock(). Since this is outside of QEMU,
|
# pthread_mutex_lock(). Since this is outside of QEMU,
|
||||||
# we choose to ignore it.
|
# we choose to ignore it.
|
||||||
race:pthread_mutex_init
|
race:pthread_mutex_init
|
||||||
|
@ -87,7 +87,7 @@ Build/%.fat: Build/%.efi
|
|||||||
.NOTPARALLEL:
|
.NOTPARALLEL:
|
||||||
|
|
||||||
# In turn, the "build" utility of edk2 BaseTools invokes another "make".
|
# In turn, the "build" utility of edk2 BaseTools invokes another "make".
|
||||||
# Although the outer "make" process advertizes its job server to all child
|
# Although the outer "make" process advertises its job server to all child
|
||||||
# processes via MAKEFLAGS in the environment, the outer "make" closes the job
|
# processes via MAKEFLAGS in the environment, the outer "make" closes the job
|
||||||
# server file descriptors (exposed in MAKEFLAGS) before executing a recipe --
|
# server file descriptors (exposed in MAKEFLAGS) before executing a recipe --
|
||||||
# unless the recipe is recognized as a recursive "make" recipe. Recipes that
|
# unless the recipe is recognized as a recursive "make" recipe. Recipes that
|
||||||
|
@ -1486,7 +1486,7 @@ int main(int argc, char **argv)
|
|||||||
g_test_add_func("/literals/keyword", keyword_literal);
|
g_test_add_func("/literals/keyword", keyword_literal);
|
||||||
|
|
||||||
g_test_add_func("/literals/interpolation/valid", interpolation_valid);
|
g_test_add_func("/literals/interpolation/valid", interpolation_valid);
|
||||||
g_test_add_func("/literals/interpolation/unkown", interpolation_unknown);
|
g_test_add_func("/literals/interpolation/unknown", interpolation_unknown);
|
||||||
g_test_add_func("/literals/interpolation/string", interpolation_string);
|
g_test_add_func("/literals/interpolation/string", interpolation_string);
|
||||||
|
|
||||||
g_test_add_func("/dicts/simple_dict", simple_dict);
|
g_test_add_func("/dicts/simple_dict", simple_dict);
|
||||||
|
@ -454,7 +454,7 @@ static void test_timer_schedule(void)
|
|||||||
|
|
||||||
g_assert_cmpint(data.n, ==, 0);
|
g_assert_cmpint(data.n, ==, 0);
|
||||||
|
|
||||||
/* timer_mod may well cause an event notifer to have gone off,
|
/* timer_mod may well cause an event notifier to have gone off,
|
||||||
* so clear that
|
* so clear that
|
||||||
*/
|
*/
|
||||||
do {} while (aio_poll(ctx, false));
|
do {} while (aio_poll(ctx, false));
|
||||||
|
@ -98,9 +98,9 @@ static BlockDriverState *exclusive_writer_node(const char *name)
|
|||||||
* | perm: write, read
|
* | perm: write, read
|
||||||
* | shared: except write
|
* | shared: except write
|
||||||
* v
|
* v
|
||||||
* +-------------------+ +----------------+
|
* +--------------------+ +----------------+
|
||||||
* | passtrough filter |---------->| null-co node |
|
* | passthrough filter |--------->| null-co node |
|
||||||
* +-------------------+ +----------------+
|
* +--------------------+ +----------------+
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* and then, tries to append filter under node. Expected behavior: fail.
|
* and then, tries to append filter under node. Expected behavior: fail.
|
||||||
@ -114,9 +114,9 @@ static BlockDriverState *exclusive_writer_node(const char *name)
|
|||||||
* | perm: write, read
|
* | perm: write, read
|
||||||
* | shared: except write
|
* | shared: except write
|
||||||
* v
|
* v
|
||||||
* +-------------------+
|
* +--------------------+
|
||||||
* | passtrough filter |
|
* | passthrough filter |
|
||||||
* +-------------------+
|
* +--------------------+
|
||||||
* | |
|
* | |
|
||||||
* perm: write, read | | perm: write, read
|
* perm: write, read | | perm: write, read
|
||||||
* shared: except write | | shared: except write
|
* shared: except write | | shared: except write
|
||||||
|
@ -244,7 +244,7 @@ static void test_secret_keyring_bad_key_access_right(void)
|
|||||||
char key_str[16];
|
char key_str[16];
|
||||||
Object *sec;
|
Object *sec;
|
||||||
|
|
||||||
g_test_skip("TODO: Need responce from Linux kernel maintainers");
|
g_test_skip("TODO: Need response from Linux kernel maintainers");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int32_t key = add_key("user", DESCRIPTION, PAYLOAD,
|
int32_t key = add_key("user", DESCRIPTION, PAYLOAD,
|
||||||
|
@ -94,7 +94,7 @@ Visitor *visitor_input_test_init(TestInputVisitorData *data,
|
|||||||
|
|
||||||
/* similar to visitor_input_test_init(), but does not expect a string
|
/* similar to visitor_input_test_init(), but does not expect a string
|
||||||
* literal/format json_string argument and so can be used for
|
* literal/format json_string argument and so can be used for
|
||||||
* programatically generated strings (and we can't pass in programatically
|
* programmatically generated strings (and we can't pass in programmatically
|
||||||
* generated strings via %s format parameters since qobject_from_jsonv()
|
* generated strings via %s format parameters since qobject_from_jsonv()
|
||||||
* will wrap those in double-quotes and treat the entire object as a
|
* will wrap those in double-quotes and treat the entire object as a
|
||||||
* string)
|
* string)
|
||||||
|
@ -135,7 +135,7 @@ static void test_compute_wait(void)
|
|||||||
g_assert(double_cmp(bkt.burst_level, 0));
|
g_assert(double_cmp(bkt.burst_level, 0));
|
||||||
g_assert(double_cmp(bkt.level, (i + 1) * (bkt.max - bkt.avg) / 10));
|
g_assert(double_cmp(bkt.level, (i + 1) * (bkt.max - bkt.avg) / 10));
|
||||||
/* We can do bursts for the 2 seconds we have configured in
|
/* We can do bursts for the 2 seconds we have configured in
|
||||||
* burst_length. We have 100 extra miliseconds of burst
|
* burst_length. We have 100 extra milliseconds of burst
|
||||||
* because bkt.level has been leaking during this time.
|
* because bkt.level has been leaking during this time.
|
||||||
* After that, we have to wait. */
|
* After that, we have to wait. */
|
||||||
result = i < 21 ? 0 : 1.8 * NANOSECONDS_PER_SECOND;
|
result = i < 21 ? 0 : 1.8 * NANOSECONDS_PER_SECOND;
|
||||||
@ -375,11 +375,11 @@ static void test_is_valid_for_value(int value, bool should_be_valid)
|
|||||||
|
|
||||||
static void test_is_valid(void)
|
static void test_is_valid(void)
|
||||||
{
|
{
|
||||||
/* negative number are invalid */
|
/* negative numbesr are invalid */
|
||||||
test_is_valid_for_value(-1, false);
|
test_is_valid_for_value(-1, false);
|
||||||
/* zero are valids */
|
/* zero is valid */
|
||||||
test_is_valid_for_value(0, true);
|
test_is_valid_for_value(0, true);
|
||||||
/* positives numers are valids */
|
/* positives numbers are valid */
|
||||||
test_is_valid_for_value(1, true);
|
test_is_valid_for_value(1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ qemu_file_monitor_test_record_free(QFileMonitorTestRecord *rec)
|
|||||||
* the file monitor event handler. Since events are
|
* the file monitor event handler. Since events are
|
||||||
* emitted in the background thread running the event
|
* emitted in the background thread running the event
|
||||||
* loop, we can't assume there is a record available
|
* loop, we can't assume there is a record available
|
||||||
* immediately. Thus we will sleep for upto 5 seconds
|
* immediately. Thus we will sleep for up to 5 seconds
|
||||||
* to wait for the event to be queued for us.
|
* to wait for the event to be queued for us.
|
||||||
*/
|
*/
|
||||||
static QFileMonitorTestRecord *
|
static QFileMonitorTestRecord *
|
||||||
|
@ -362,7 +362,7 @@ static void test_xs_node_simple(void)
|
|||||||
g_assert(data->len == strlen("something"));
|
g_assert(data->len == strlen("something"));
|
||||||
g_assert(!memcmp(data->data, "something", data->len));
|
g_assert(!memcmp(data->data, "something", data->len));
|
||||||
|
|
||||||
/* Even if we use an abolute path */
|
/* Even if we use an absolute path */
|
||||||
g_byte_array_set_size(data, 0);
|
g_byte_array_set_size(data, 0);
|
||||||
err = xs_impl_read(s, DOMID_GUEST, XBT_NULL,
|
err = xs_impl_read(s, DOMID_GUEST, XBT_NULL,
|
||||||
"/local/domain/1/some/relative/path", data);
|
"/local/domain/1/some/relative/path", data);
|
||||||
|
@ -81,7 +81,7 @@ endif
|
|||||||
@echo " QEMU_IMG=/path/to/qemu-img - Change path to qemu-img tool"
|
@echo " QEMU_IMG=/path/to/qemu-img - Change path to qemu-img tool"
|
||||||
@echo " QEMU_LOCAL=1 - Use QEMU binary local to this build."
|
@echo " QEMU_LOCAL=1 - Use QEMU binary local to this build."
|
||||||
@echo " TARGET_LIST=a,b,c - Override target list in builds"
|
@echo " TARGET_LIST=a,b,c - Override target list in builds"
|
||||||
@echo " V=1 - Enable verbose ouput on host and guest commands"
|
@echo " V=1 - Enable verbose output on host and guest commands"
|
||||||
|
|
||||||
vm-build-all: $(addprefix vm-build-, $(IMAGES))
|
vm-build-all: $(addprefix vm-build-, $(IMAGES))
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class UbuntuVM(basevm.BaseVM):
|
|||||||
# then we will jump right to the graceful shutdown
|
# then we will jump right to the graceful shutdown
|
||||||
if self._config['install_cmds'] != "":
|
if self._config['install_cmds'] != "":
|
||||||
# Issue the install commands.
|
# Issue the install commands.
|
||||||
# This can be overriden by the user in the config .yml.
|
# This can be overridden by the user in the config .yml.
|
||||||
install_cmds = self._config['install_cmds'].split(',')
|
install_cmds = self._config['install_cmds'].split(',')
|
||||||
for cmd in install_cmds:
|
for cmd in install_cmds:
|
||||||
self.ssh_root(cmd)
|
self.ssh_root(cmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user