On 04/03/2013 03:20 PM, Yang Dongsheng wrote:
On 2013/4/3 14:44, Alex Jia wrote:
On 04/01/2013 06:40 PM, Yang Dongsheng wrote:
Signed-off-by: yangdongsheng <[email protected]>
---
libvirt/tests/cfg/virsh_connect.cfg | 49
+++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
create mode 100644 libvirt/tests/cfg/virsh_connect.cfg
diff --git a/libvirt/tests/cfg/virsh_connect.cfg
b/libvirt/tests/cfg/virsh_connect.cfg
new file mode 100644
index 0000000..3ba9387
--- /dev/null
+++ b/libvirt/tests/cfg/virsh_connect.cfg
@@ -0,0 +1,49 @@
+- virsh_connect:
+ type = virsh_connect
+ virt_test_type = libvirt
+ # VM is not needed for this test
+ vms =
+ main_vm =
+ start_vm = "no"
+ # libvirtd status
+ libvirtd = "on"
+ # connect_arg is the uri connect to :
+ # "" - default uri
+ # "xen:///" - this is used to connect to the local Xen
hypervisor, this is the default
+ # "qemu:///system" - connect locally as root to the daemon
supervising QEmu and KVM domains
+ # "qemu:///session" - connect locally as a normal user to his
own set of QEmu and KVM domains
+ # "lxc:///" - connect to a local linux container
Does this test support remote URI? for example, qemu:///<ip>/system,
for virsh connect testing, I also expect to see some test cases about
remote access, thanks.
yeah, there is a variant in normal_test named remote.
> - remote_connect:
> remote_ip = "ENTER.YOUR.REMOTE.HOST.IP"
> remote_root_password =
"ENTER.YOUR.REMOTE.ROOT.PASSWORD"
> connect_arg = "remote"
en....I think I forgot to add the comment.
Yes, I saw these, but they're not enough, the transports may be ssh, tcp, tls
and unix, etc, so some test scenario
have a little complex(please see http://libvirt.org/remote.html), for example,
(I) Positive
EXAM1:
1. append auth_unix_rw="sasl" into the /etc/libvirt/libvirtd.conf
2. add sasl user
# saslpasswd2 -a libvirt test
(input your passwd)
# sasldblistusers2 -f /etc/libvirt/passwd.db
xxx@yyy <mailto:[email protected]>: userPassword
3. add auth.conf file in the /etc/libvirtd/
# cat /etc/libvirt/auth.conf
[credentials-sasl]
authname=test
password=autotest
[auth-libvirt-localhost]
credentials=sasl
4. restart libvirtd service
service libvirtd restart
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon:
5. without sasl username and passwd
# virsh -c qemu+unix:///system list
Id Name State
----------------------------------------------------
1 test running
EXAM2:
On the server:
1. edit /etc/sysconfig/libvirtd and uncomment LIBVIRTD_ARGS line
LIBVIRTD_ARGS="--listen"
2. edit /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp =1
tcp_port = "16510"
auth_tcp = "none"
3. restart libvirtd service
#service libvirtd restart
4. Refresh iptables or add some policies
#iptables -F
On the client:
1. remotely connect above server witch tcp transports
# virsh -c qemu+tcp://<ip>:16510/system
(II) Negative
EXAM1:
1. stop libvirtd service on the remote server
# service libvirtd stop
2. connect remote server from client
# virsh -c qemu+ssh://<ip>/system
EXAM2:
1. Disable ssh root login on the server
appending "PermitRootLogin = no" into /etc/ssh/sshd_config and restart sshd
service on the server
2. Remotely connect server with ssh transports from libvirt client
# virsh -c qemu+ssh://<ip>/system
There are many test cases can be designed for remote access, it will be huge
work for us, so we also may
do it later if you want, I think it should be okay if your patches series just
focus basic connect operations,
but considering future case extension, we shouldn't hard cord transports to
'ssh'.
+ connect_arg = ""
+ # connect_opt is the option of command connect :
+ # "--readonly" - read only mode to connect
+ connect_opt = ""
+ variants:
+ - normal_test:
+ status_error = "no"
+ variants:
+ - default:
+ - xen_uri:
+ connect_arg = "xen:///"
+ - qemu_system_uri:
+ connect_arg = "qemu:///system"
+ - qemu_session_uri:
+ connect_arg = "qemu:///session"
+ - lxc_uri:
+ connect_arg = "lxc:///"
+ - readonly:
+ connect_opt = "--readonly"
+ - error_test:
+ status_error = "yes"
+ variants:
+ - unrecognized_arg:
+ connect_arg = "xyz"
+ - unrecognized_opt:
+ connect_opt = "--xyz"
+ - multi_arg:
+ connect_arg = "uri xyz"
+ - libvirtd_stop:
+ libvirtd = "off"
--
1.7.1
_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel
_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel