1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-27 07:22:07 +03:00
libvirt/tests
John Ferlan 1d35f6ffe1 polkit: Adjust message when authentication agent isn't found
When there isn't a ssh -X type session running and a user has not
been added to the libvirt group, attempts to run 'virsh -c qemu:///system'
commands from an otherwise unprivileged user will fail with rather
generic or opaque error message:

    "error: authentication failed: no agent is available to authenticate"

This patch will adjust the error code and message to help reflect the
situation that the problem is the requested mechanism is UNAVAILABLE and
a slightly more descriptive error. The result on a failure then becomes:

    "error: authentication unavailable: no polkit agent available to
            authenticate action 'org.libvirt.unix.manage'"

A bit more history on this - at one time a failure generated the
following type message when running the 'pkcheck' as a subprocess:

"error: authentication failed: polkit\56retains_authorization_after_challenge=1
Authorization requires authentication but no agent is available."

but, a patch was generated to adjust the error message to help provide
more details about what failed. This was pushed as commit id '96a108c99'.
That patch prepended a "polkit: " to the output. It really didn't solve
the problem, but gave a hint.

After some time it was deemed using DBus API calls directly was a
better way to go (since pkcheck calls them anyway). So, commit id
'1b854c76' (more or less) copied the code from remoteDispatchAuthPolkit
and adjusted it. Then commit id 'c7542573' adjusted the remote.c
code to call the new API (virPolkitCheckAuth). Finally, commit id
'308c0c5a' altered the code to call DBus APIs directly. In doing
so, it reverted the failing error message to the generic message
that would have been received from DBus anyway.
2016-03-01 06:50:16 -05:00
..
bhyvexml2argvdata bhyve: bhyveload: respect boot dev and boot order 2016-01-25 04:19:33 +03:00
bhyvexml2xmloutdata
capabilityschemadata capabilities: Format <domain/> properly 2014-12-24 18:01:44 +01:00
commanddata command: test umask support 2014-09-03 09:36:13 -06:00
confdata Add configuration options for permissions on daemon's admin socket 2015-06-16 13:46:21 +02:00
cputestdata tests: Add some compatibility-related cases to the CPU tests 2015-08-21 15:42:38 -07:00
domaincapsschemadata qemu: Add AAVMF to the list of known UEFIs 2015-01-29 15:20:47 +01:00
domainconfdata
domainschemadata docs: Rename 'parallels' to 'vz' 2015-08-25 07:21:33 -04:00
domainsnapshotxml2xmlin
domainsnapshotxml2xmlout device: cleanup input device code 2016-01-26 17:53:33 +01:00
fchostdata/fc_host
genericxml2xmlindata tests: add genericxml2xmltest 2016-01-08 21:21:34 -05:00
genericxml2xmloutdata tests: add genericxml2xmltest 2016-01-08 21:21:34 -05:00
interfaceschemadata interface: allow multiple IPv4 addresses + dhcp on a single interface 2015-05-22 10:14:01 -04:00
lxcconf2xmldata lxc: use virDomainDefPostParse for parsing LXC config string 2015-12-09 12:59:02 +01:00
lxcxml2xmldata lxc: Inherit namespace feature 2015-08-26 11:28:30 +01:00
lxcxml2xmloutdata
networkxml2confdata network: escape quotes for dsmasq conf contents 2015-06-09 13:56:00 -04:00
networkxml2firewalldata tests: redo test argv file line wrapping 2015-11-09 15:50:39 +00:00
networkxml2xmlin conf: Don't try formating non-existing addresses 2015-08-11 16:07:41 +02:00
networkxml2xmlout conf: Don't try formating non-existing addresses 2015-08-11 16:07:41 +02:00
networkxml2xmlupdatein network: validate DHCP ranges are completely within defined network 2015-06-02 12:40:07 -04:00
networkxml2xmlupdateout network: validate DHCP ranges are completely within defined network 2015-06-02 12:40:07 -04:00
nodedevschemadata nodedev: add RDMA and tx-udp_tnl-segmentation NIC capabilities 2015-07-21 07:08:35 -04:00
nodeinfodata tests: Remove unused nodeinfo test data 2015-10-22 09:32:58 +02:00
nwfilterxml2firewalldata tests: redo test argv file line wrapping 2015-11-09 15:50:39 +00:00
nwfilterxml2xmlin nwfilter: Add support for icmpv6 filtering 2015-01-07 11:41:49 -05:00
nwfilterxml2xmlout nwfilter: Add support for icmpv6 filtering 2015-01-07 11:41:49 -05:00
qemuagentdata qemu: add test for qemuAgentGetFSInfo 2014-11-24 10:29:16 -05:00
qemuargv2xmldata qemu: parse: drop redundant AddImplicitControllers 2016-02-19 09:45:23 -05:00
qemucapabilitiesdata qemu: add spice opengl support 2016-03-01 09:45:47 +01:00
qemucaps2xmldata qemu: assume various QEMU 0.10 features are always available 2015-11-10 10:38:18 +00:00
qemuhelpdata qemu: mandate QEMU version 0.12.0 or newer 2015-11-10 10:38:00 +00:00
qemuhotplugtestdata device: cleanup input device code 2016-01-26 17:53:33 +01:00
qemumonitorjsondata
qemuxml2argvdata qemu: add spice opengl support 2016-03-01 09:45:47 +01:00
qemuxml2xmloutdata qemu: add spice opengl support 2016-03-01 09:45:47 +01:00
secretxml2xmlin
securityselinuxhelperdata
securityselinuxlabeldata caps: Use DomainDataLookup to replace GuestDefault* 2015-04-20 16:43:13 -04:00
sexpr2xmldata domain: add implicit controllers from post parse 2016-02-19 09:45:23 -05:00
storagepoolschemadata
storagepoolxml2xmlin conf: Add storage pool device attribute part_separator 2016-01-19 13:02:59 -05:00
storagepoolxml2xmlout conf: Add storage pool device attribute part_separator 2016-01-19 13:02:59 -05:00
storagevolschemadata
storagevolxml2argvdata tests: add vol-qcow2-zerocapacity test to storagevolxml2argvtest 2015-07-24 11:23:45 -04:00
storagevolxml2xmlin tests: add vol-qcow2-zerocapacity test to storagevolxml2argvtest 2015-07-24 11:23:45 -04:00
storagevolxml2xmlout conf: storage: Don't emit empty <permissions> block 2015-05-25 20:52:57 -04:00
sysinfodata sysinfo: Fix reports on ARM 2015-05-21 18:13:18 +02:00
vboxsnapshotxmldata
vircaps2xmldata
vircgroupdata tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
virfiledata
virnetdaemondata virnetdaemon: Store servers in a hash table 2016-02-17 12:46:34 +01:00
virnetdevtestdata/sys/class/net Introduce virnetdevtest 2015-04-14 19:33:02 +02:00
virnetserverdata tests: Adapt virnetservertest to daemon refactor 2015-06-16 13:46:20 +02:00
virpcitestdata
virscsidata
virusbtestdata/sys_bus_usb/devices
vmwareverdata
vmx2xmldata device: cleanup input device code 2016-01-26 17:53:33 +01:00
xencapsdata capabilities: Format <domain/> properly 2014-12-24 18:01:44 +01:00
xlconfigdata xenconfig: support xl<->xml conversion of rbd disk devices 2016-02-22 11:46:50 -07:00
xmconfigdata domain: add implicit controllers from post parse 2016-02-19 09:45:23 -05:00
xml2sexprdata xenconfig: support vif bandwidth in sexpr parser and formatter 2016-01-08 18:56:00 -07:00
xml2vmxdata vmx: Adapt to emptyBackingString for cdrom-image 2016-01-25 08:34:23 +01:00
.valgrind.supp
bhyvexml2argvmock.c bhyvexml2argvmock: change int to size_t for tapfdSize 2015-02-11 14:30:45 +01:00
bhyvexml2argvtest.c bhyve: bhyveload: respect boot dev and boot order 2016-01-25 04:19:33 +03:00
bhyvexml2xmltest.c testCompareDomXML2XMLFiles: add parseFlags parameter 2016-02-26 09:47:45 +01:00
capabilityschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
commandhelper.c Remove unnecessary curly brackets in tests/ 2014-11-14 17:13:36 +01:00
commandtest.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
cpuset
cputest.c tests: Add some compatibility-related cases to the CPU tests 2015-08-21 15:42:38 -07:00
define-dev-segfault
domaincapsschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
domaincapstest.c tests: fix some memleaks in tests 2015-04-27 10:04:38 +02:00
domainconftest.c tests: Use *DefParseFile more 2015-04-23 17:08:48 -04:00
domainschematest tests: qemuargv2xml: separate from qemuxml2argv data 2016-02-05 15:07:07 -05:00
domainsnapshotschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
domainsnapshotxml2xmltest.c conf: add caps to virDomainSnapshotDefFormat 2016-02-05 10:57:39 +00:00
esxutilstest.c Remove unnecessary curly brackets in tests/ 2014-11-14 17:13:36 +01:00
eventtest.c tests: eventtest: Fix coverity warning 2015-10-07 10:48:45 -04:00
fchosttest.c
fdstreamtest.c
genericxml2xmltest.c testCompareDomXML2XMLFiles: add parseFlags parameter 2016-02-26 09:47:45 +01:00
int-overflow
interfaceschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
interfacexml2xmltest.c tests: use virtTestDifferenceFull in tests where we have output file 2016-01-26 17:53:33 +01:00
jsontest.c json: enhance parser test 2015-06-25 09:11:15 +02:00
libvirtd-fail
libvirtd-pool
libvirtdconftest.c rpc: Remove keepalive_required option 2015-08-10 13:15:56 +02:00
lxcconf2xmltest.c tests: lxcconf2xml: Drop XML blanking 2016-02-17 11:07:21 -05:00
lxcxml2xmltest.c tests: add a test for persistent LXC XML parsing 2016-02-26 09:47:45 +01:00
Makefile.am tests: Rename virmockdbus -> virdbusmock for consistency 2016-02-11 18:24:32 +01:00
metadatatest.c test: metadata: Improve test coverage 2014-07-17 17:04:12 +02:00
networkschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
networkxml2conftest.c network: escape quotes for dsmasq conf contents 2015-06-09 13:56:00 -04:00
networkxml2firewalltest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
networkxml2xmltest.c conf: Don't try formating non-existing addresses 2015-08-11 16:07:41 +02:00
networkxml2xmlupdatetest.c network: validate DHCP ranges are completely within defined network 2015-06-02 12:40:07 -04:00
nodedevschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
nodedevxml2xmltest.c tests: use virtTestDifferenceFull in tests where we have output file 2016-01-26 17:53:33 +01:00
nodeinfomock.c tests: Prepare for subcore tests 2015-08-03 08:38:46 -04:00
nodeinfotest.c tests: Add subcores3 nodeinfo test 2015-08-03 08:38:47 -04:00
nwfilterebiptablestest.c tests.nwfilterebiptablestest: swap actual and expected 2016-01-08 16:08:15 +01:00
nwfilterschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
nwfilterxml2firewalltest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
nwfilterxml2xmltest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
objecteventtest.c objecteventtest: Check for virNetwork* return values 2015-03-23 09:56:15 +01:00
objectlocking.ml network_conf: Make virNetworkObj actually virObject 2015-03-11 16:58:48 +01:00
oomtrace.pl
openvzutilstest.c conf: add caps to virDomainDefFormat* 2016-02-04 12:38:26 +00:00
openvzutilstest.conf
pkix_asn1_tab.c
qemuagenttest.c tests: split out common qemu driver initialization 2015-09-22 13:56:59 +02:00
qemuargv2xmltest.c tests: qemuargv2xml: Drop memory XML blanking 2016-02-17 11:07:21 -05:00
qemucapabilitiestest.c tests: add qemu 2.6 caps test 2015-12-24 14:49:38 +00:00
qemucaps2xmlmock.c tests: introduce qemucaps2xmlmock 2015-03-27 16:55:33 +01:00
qemucaps2xmltest.c tests: Resolve Coverity RESOURCE_LEAK 2015-09-24 09:53:38 -04:00
qemucommandutiltest.c tests: fix some memleaks in tests 2015-04-27 10:04:38 +02:00
qemuhelptest.c qemu: assume various QEMU 0.10 features are always available 2015-11-10 10:38:18 +00:00
qemuhotplugtest.c qemu: Move qemuAssign*Alias* API's into their own module 2016-02-16 11:07:48 -05:00
qemumonitorjsontest.c qemu: Rename qemuMonitorMigrationStatus struct 2016-01-08 18:18:58 +01:00
qemumonitortest.c tests: Avoid use of virQEMUDriverCreateXMLConf(NULL) 2015-09-22 17:05:16 +02:00
qemumonitortestutils.c test: qemu: Fix qemu monitor test utils to allow testing HMP 2015-03-11 11:28:03 +01:00
qemumonitortestutils.h
qemuxml2argvmock.c test: qemuxml2argv: Mock virMemoryMaxValue to remove 32/64 bit difference 2015-12-11 12:23:38 +01:00
qemuxml2argvtest.c qemu: add spice opengl support 2016-03-01 09:45:47 +01:00
qemuxml2xmltest.c qemu: add spice opengl support 2016-03-01 09:45:47 +01:00
read-bufsiz
read-non-seekable
reconnect.c
schematestutils.sh Cleanup srcdir usage 2015-04-27 16:03:31 +02:00
scsihosttest.c tests: scsihost: Use fakerootdir instead of fakesysfsdir 2015-12-09 15:22:59 +01:00
seclabeltest.c virSecurityManagerNew: Turn array of booleans into flags 2015-10-07 17:51:28 +02:00
secretschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
secretxml2xmltest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
securityselinuxhelper.c build: accomodate selinux 2.5 header API change 2016-02-24 15:14:30 -07:00
securityselinuxlabeltest.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
securityselinuxtest.c virSecurityManagerNew: Turn array of booleans into flags 2015-10-07 17:51:28 +02:00
sexpr2xmltest.c conf: add caps to virDomainDefFormat* 2016-02-04 12:38:26 +00:00
shunloadhelper.c
shunloadtest.c Remove unnecessary curly brackets in tests/ 2014-11-14 17:13:36 +01:00
sockettest.c network: validate network NAT range 2015-08-10 13:06:56 -04:00
ssh.c
start
statstest.c tests: Add VIR_TEST_DEBUG and VIR_TEST_VERBOSE 2015-04-23 17:08:48 -04:00
storagebackendsheepdogtest.c tests: sheepdog: Drop use of virtTestResult 2015-10-05 14:34:04 -04:00
storagepoolschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
storagepoolxml2xmltest.c conf: Add storage pool device attribute part_separator 2016-01-19 13:02:59 -05:00
storagevolschematest tests: Fix running schematests directly from topdir 2016-01-08 21:21:34 -05:00
storagevolxml2argvtest.c tests: add vol-qcow2-zerocapacity test to storagevolxml2argvtest 2015-07-24 11:23:45 -04:00
storagevolxml2xmltest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
sysinfotest.c sysinfo: Fix reports on ARM 2015-05-21 18:13:18 +02:00
test_conf.c test_conf: Resolve Coverity RESOURCE_LEAK 2014-09-03 15:00:19 -04:00
test_conf.sh
test-lib.sh tests: avoid realpath in test-lib.sh 2016-02-01 13:03:28 -07:00
test-wrap-argv.pl tests: Make test-wrap-argv.pl executable 2015-12-29 09:37:35 +01:00
testutils.c testCompareDomXML2XMLFiles: add parseFlags parameter 2016-02-26 09:47:45 +01:00
testutils.h testCompareDomXML2XMLFiles: add parseFlags parameter 2016-02-26 09:47:45 +01:00
testutilslxc.c tests: Add VIR_TEST_DEBUG and VIR_TEST_VERBOSE 2015-04-23 17:08:48 -04:00
testutilslxc.h
testutilsqemu.c qemuTestDriverInit: fill driver with zeroes 2016-01-18 13:22:14 +01:00
testutilsqemu.h Implement infrastracture for mocking up QEMU capabilities cache 2015-09-22 13:56:59 +02:00
testutilsxen.c caps: Convert to use VIR_DOMAIN_VIRT internally 2015-04-20 16:40:26 -04:00
testutilsxen.h tests: Tests for the xen-xl parser 2015-01-14 08:28:50 -07:00
utiltest.c util: add virDiskNameParse to handle disk and partition idx 2015-11-18 13:48:38 -07:00
vboxsnapshotxmltest.c
vcpupin test: Touch up error message when attempting to pin invalid vCPU 2016-01-25 17:53:08 +01:00
viralloctest.c
viratomictest.c
virauthconfigtest.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
virbitmaptest.c util: bitmap: Introduce bitmap subtraction 2016-02-05 16:21:45 +01:00
virbuftest.c tests: Add VIR_TEST_DEBUG and VIR_TEST_VERBOSE 2015-04-23 17:08:48 -04:00
vircaps2xmltest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
vircapstest.c conf: Add new VIR_DOMAIN_VIRT_NONE enum 2015-09-25 15:33:53 -04:00
vircgroupmock.c vircgroupmock: Mock access("/sys/devices/system/cpu/present") 2016-02-25 11:14:29 +01:00
vircgrouptest.c cgroup: Prepare for sparse vCPU topologies in virCgroupGetPercpuStats 2016-02-08 09:51:34 +01:00
vircryptotest.c
virdbusmock.c tests: Rename virmockdbus -> virdbusmock for consistency 2016-02-11 18:24:32 +01:00
virdbustest.c dbus: Don't unref NULL messages 2016-02-11 11:35:02 +01:00
virdrivermoduletest.c Removing probing of secondary drivers 2015-01-27 12:02:04 +00:00
virendiantest.c
virfiletest.c util: file: Don't carelessly sanitize URIs 2015-04-09 09:43:36 +02:00
virfirewalltest.c tests: Rename virmockdbus -> virdbusmock for consistency 2016-02-11 18:24:32 +01:00
virhashdata.h
virhashtest.c util: Refactor virHashForEach so it returns as soon as an iterator fails 2016-02-17 12:46:34 +01:00
virhostdevtest.c tests: Fix typo oaque -> opaque 2016-02-23 10:36:13 +01:00
viridentitytest.c
viriscsitest.c
virkeycodetest.c
virkeyfiletest.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
virkmodtest.c
virlockspacetest.c
virlogtest.c
virmock.h tests: fix documentation for mocking methods 2014-11-27 11:17:56 +01:00
virnetdaemontest.c virnetdaemon: Store servers in a hash table 2016-02-17 12:46:34 +01:00
virnetdevbandwidthmock.c Iface: disallow network tuning in session mode globally 2014-11-06 14:28:37 +01:00
virnetdevbandwidthtest.c virnetdevbandwidth: Compute quantum value 2016-02-05 16:43:19 +01:00
virnetdevmock.c Introduce virnetdevtest 2015-04-14 19:33:02 +02:00
virnetdevtest.c Introduce virnetdevtest 2015-04-14 19:33:02 +02:00
virnetmessagetest.c
virnetserverclientmock.c
virnetserverclienttest.c
virnetsockettest.c Remove new lines from log messages 2015-11-04 13:09:35 +01:00
virnettlscontexttest.c tests: force FIPS testing mode with new enough GNU TLS versions 2014-09-04 11:56:39 +02:00
virnettlshelpers.c tests: extend workaround for gnutls private key loading failure 2015-08-04 12:28:24 +01:00
virnettlshelpers.h
virnettlssessiontest.c tests: force FIPS testing mode with new enough GNU TLS versions 2014-09-04 11:56:39 +02:00
virpcimock.c tests: Use more specific names for variables 2015-12-09 15:22:58 +01:00
virpcitest.c tests: Fix typo oaque -> opaque 2016-02-23 10:36:13 +01:00
virpolkittest.c polkit: Adjust message when authentication agent isn't found 2016-03-01 06:50:16 -05:00
virportallocatormock.c virportallocatortest: Run on linux only 2016-02-12 16:13:31 +01:00
virportallocatortest.c virportallocatortest: Run on linux only 2016-02-12 16:13:31 +01:00
virrotatingfiletest.c virlogd: fix crash if log file exists and it's larger the maxlen 2015-11-30 10:45:45 +01:00
virscsitest.c virfile: Check for existence of dir in virFileDeleteTree 2015-09-16 11:23:16 -04:00
virsh-all
virsh-optparse virsh: Move error messages inside vshCommandOpt*() functions 2015-06-02 09:20:31 -04:00
virsh-schedinfo
virsh-synopsis
virsh-undefine
virsh-uriprecedence
virshtest.c
virstoragetest.c util: storage: Fix parsing of nbd:// URI without path 2015-02-04 08:38:25 +01:00
virstringtest.c virStringListLength: Ensure const correctness 2016-02-09 15:44:58 -05:00
virsystemdtest.c tests: Rename virmockdbus -> virdbusmock for consistency 2016-02-11 18:24:32 +01:00
virt-aa-helper-test virt-aa-helper: allow access to /usr/share/ovmf/ 2015-08-24 13:00:39 +02:00
virtimetest.c Remove new lines from log messages 2015-11-04 13:09:35 +01:00
virtypedparamtest.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
viruritest.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
virusbmock.c
virusbtest.c
vmwarevertest.c
vmx2xmltest.c conf: add caps to virDomainDefFormat* 2016-02-04 12:38:26 +00:00
xencapstest.c tests: Add virtTestCompareToFile 2015-04-23 17:08:48 -04:00
xlconfigtest.c xenconfig: support xl<->xml conversion of rbd disk devices 2016-02-22 11:46:50 -07:00
xmconfigtest.c conf: add caps to virDomainDefFormat* 2016-02-04 12:38:26 +00:00
xml2sexprtest.c xenconfig: support vif bandwidth in sexpr parser and formatter 2016-01-08 18:56:00 -07:00
xml2vmxtest.c vmx: Adapt to emptyBackingString for cdrom-image 2016-01-25 08:34:23 +01:00