mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
This commit introduces "check-xl-vcpupin-parse" for helping
verifying and debugging the (v)CPU bitmap parsing code in xl.
The script runs "xl -N vcpu-pin 0 all <some strings>"
repeatedly, with various input strings, and checks that the
output is as expected.
This is what the script can do:
# ./check-xl-vcpupin-parse -h
usage: ./check-xl-vcpupin-parse [options]
Tests various vcpu-pinning strings. If run without arguments acts
as follows:
- generates some test data and saves them in
check-xl-vcpupin-parse.data;
- tests all the generated configurations (reading them back from
check-xl-vcpupin-parse.data).
An example of a test vector file is provided in
check-xl-vcpupin-parse.data-example.
Options:
-h prints this message
-r seed uses seed for initializing the rundom number generator
(default: the script PID)
-s string tries using string as a vcpu pinning configuration and
reports whether that succeeds or not
-o ofile save the test data in ofile
(default: check-xl-vcpupin-parse.data)
-i ifile read test data from ifile
An example test data file (generated on a 2 NUMA nodes, 16 CPUs
host) is being provided in check-xl-vcpupin-parse.data-example.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
# WARNING: some of these tests are topology based tests.
|
|
# Expect failures if the topology is not detected correctly
|
|
# detected topology: 16 CPUs, 2 nodes, 8 CPUs per node.
|
|
#
|
|
# seed used for random number generation: seed=13328.
|
|
#
|
|
# Format is as follows:
|
|
# test-string*expected-return-code*expected-output
|
|
#
|
|
# Testing a wrong configuration
|
|
foo*255*
|
|
# Testing the 'all' syntax
|
|
all*0*cpumap: all
|
|
nodes:all*0*cpumap: all
|
|
all,nodes:all*0*cpumap: all
|
|
all,^nodes:0,all*0*cpumap: all
|
|
# Testing the empty cpumap case
|
|
^0*0*cpumap: none
|
|
# A few attempts of pinning to just one random cpu
|
|
0*0*cpumap: 0
|
|
9*0*cpumap: 9
|
|
6*0*cpumap: 6
|
|
0*0*cpumap: 0
|
|
# A few attempts of pinning to all but one random cpu
|
|
all,^12*0*cpumap: 0-11,13-15
|
|
all,^6*0*cpumap: 0-5,7-15
|
|
all,^3*0*cpumap: 0-2,4-15
|
|
all,^7*0*cpumap: 0-6,8-15
|
|
# A few attempts of pinning to a random range of cpus
|
|
13-15*0*cpumap: 13-15
|
|
7*0*cpumap: 7
|
|
3-5*0*cpumap: 3-5
|
|
8-11*0*cpumap: 8-11
|
|
# A few attempts of pinning to just one random node
|
|
nodes:1*0*cpumap: 8-15
|
|
nodes:0*0*cpumap: 0-7
|
|
nodes:0*0*cpumap: 0-7
|
|
nodes:0*0*cpumap: 0-7
|
|
# A few attempts of pinning to all but one random node
|
|
all,^nodes:0*0*cpumap: 8-15
|
|
all,^nodes:1*0*cpumap: 0-7
|
|
all,^nodes:1*0*cpumap: 0-7
|
|
all,^nodes:0*0*cpumap: 8-15
|
|
# A few attempts of pinning to a random range of nodes
|
|
nodes:1-1*0*cpumap: 8-15
|
|
nodes:1-1*0*cpumap: 8-15
|
|
nodes:0-1*0*cpumap: all
|
|
nodes:0-0*0*cpumap: 0-7
|
|
# A few attempts of pinning to a node but excluding one random cpu
|
|
nodes:1,^8*0*cpumap: 9-15
|
|
nodes:0,^6*0*cpumap: 0-5,7
|
|
nodes:1,^9*0*cpumap: 8,10-15
|
|
nodes:0,^5*0*cpumap: 0-4,6-7
|