From 84b6d70fece3229093f36bef305e8eebfe80182c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 28 Jul 2014 13:37:11 +0200 Subject: [PATCH] update java tests --- src/oca/java/test/VirtualNetworkTest.java | 6 +- src/oca/java/test/oned.conf | 328 ++++++++++++++++------ 2 files changed, 240 insertions(+), 94 deletions(-) diff --git a/src/oca/java/test/VirtualNetworkTest.java b/src/oca/java/test/VirtualNetworkTest.java index a09c44c0c7..977a2979c4 100644 --- a/src/oca/java/test/VirtualNetworkTest.java +++ b/src/oca/java/test/VirtualNetworkTest.java @@ -202,13 +202,13 @@ public class VirtualNetworkTest res = vnet.release("192.168.0.11", 0); assertTrue( res.getErrorMessage(), !res.isError() ); -//* + res = vnet.release("192.168.0.10"); - assertTrue( res.isError() ); + assertTrue( res.getErrorMessage(), !res.isError() ); res = vnet.release("192.168.100.1"); assertTrue( res.isError() ); -//*/ + vnet.delete(); } diff --git a/src/oca/java/test/oned.conf b/src/oca/java/test/oned.conf index 7f201c4f7b..da03cb5716 100644 --- a/src/oca/java/test/oned.conf +++ b/src/oca/java/test/oned.conf @@ -10,11 +10,17 @@ # # MONITORING_INTERVAL: Time in seconds between host and VM monitorization. # +# MONITORING_THREADS: Max. number of threads used to process monitor messages +# # HOST_PER_INTERVAL: Number of hosts monitored in each interval. # HOST_MONITORING_EXPIRATION_TIME: Time, in seconds, to expire monitoring # information. Use 0 to disable HOST monitoring recording. # -# VM_PER_INTERVAL: Number of VMs monitored in each interval. +# VM_INDIVIDUAL_MONITORING: VM monitoring information is obtained along with the +# host information. For some custom monitor drivers you may need activate the +# individual VM monitoring process. +# VM_PER_INTERVAL: Number of VMs monitored in each interval, if the individual +# VM monitoring is set to yes. # VM_MONITORING_EXPIRATION_TIME: Time, in seconds, to expire monitoring # information. Use 0 to disable VM monitoring recording. # @@ -52,13 +58,15 @@ LOG = [ #MANAGER_TIMER = 30 -MONITORING_INTERVAL = 300 +MONITORING_INTERVAL = 60 +MONITORING_THREADS = 50 #HOST_PER_INTERVAL = 15 -#HOST_MONITORING_EXPIRATION_TIME = 86400 +#HOST_MONITORING_EXPIRATION_TIME = 43200 +#VM_INDIVIDUAL_MONITORING = "no" #VM_PER_INTERVAL = 5 -#VM_MONITORING_EXPIRATION_TIME = 86400 +#VM_MONITORING_EXPIRATION_TIME = 14400 SCRIPTS_REMOTE_DIR=/var/tmp/one @@ -78,6 +86,28 @@ VNC_BASE_PORT = 5900 #VM_SUBMIT_ON_HOLD = "NO" +#******************************************************************************* +# Federation configuration attributes +#------------------------------------------------------------------------------- +# Control the federation capabilities of oned. Operation in a federated setup +# requires a special DB configuration. +# +# FEDERATION: Federation attributes +# MODE: Operation mode of this oned. +# STANDALONE no federated.This is the default operational mode +# MASTER this oned is the master zone of the federation +# SLAVE this oned is a slave zone +# ZONE_ID: The zone ID as returned by onezone command +# MASTER_ONED: The xml-rpc endpoint of the master oned, e.g. +# http://master.one.org:2633/RPC2 +#******************************************************************************* + +FEDERATION = [ + MODE = "STANDALONE", + ZONE_ID = 0, + MASTER_ONED = "" +] + #******************************************************************************* # XML-RPC server configuration #------------------------------------------------------------------------------- @@ -98,13 +128,21 @@ VNC_BASE_PORT = 5900 # # TIMEOUT: Maximum time in seconds the server will wait for the client to # do anything while processing an RPC +# +# RPC_LOG: Create a separated log file for xml-rpc requests, in +# "/var/log/one/one_xmlrpc.log". +# +# MESSAGE_SIZE: Buffer size in bytes for XML-RPC responses. Only relevant for +# slave zones. #******************************************************************************* -#MAX_CONN = 15 -#MAX_CONN_BACKLOG = 15 -#KEEPALIVE_TIMEOUT = 15 -#KEEPALIVE_MAX_CONN = 30 -#TIMEOUT = 15 +#MAX_CONN = 15 +#MAX_CONN_BACKLOG = 15 +#KEEPALIVE_TIMEOUT = 15 +#KEEPALIVE_MAX_CONN = 30 +#TIMEOUT = 15 +#RPC_LOG = NO +#MESSAGE_SIZE = 1073741824 #******************************************************************************* # Physical Networks configuration @@ -143,11 +181,14 @@ MAC_PREFIX = "02:00" # CDROM Image file holding a CDROM # DATABLOCK Image file holding a datablock, # always created as an empty block +# # DEFAULT_DEVICE_PREFIX: This can be set to # hd IDE prefix # sd SCSI # xvd XEN Virtual Disk # vd KVM virtual disk +# +# DEFAULT_CDROM_DEVICE_PREFIX: Same as above but for CDROM devices. #******************************************************************************* #DATASTORE_LOCATION = /var/lib/one/datastores @@ -159,6 +200,7 @@ DATASTORE_CAPACITY_CHECK = "yes" DEFAULT_IMAGE_TYPE = "OS" DEFAULT_DEVICE_PREFIX = "hd" +DEFAULT_CDROM_DEVICE_PREFIX = "hd" #******************************************************************************* # Information Driver Configuration @@ -198,7 +240,7 @@ IM_MAD = [ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- -# KVM Information Driver Manager Configuration +# KVM UDP-push Information Driver Manager Configuration # -r number of retries when monitoring a host # -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- @@ -209,7 +251,18 @@ IM_MAD = [ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- -# XEN Information Driver Manager Configuration +# KVM SSH-pull Information Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time +#------------------------------------------------------------------------------- +# IM_MAD = [ +# name = "kvm", +# executable = "one_im_ssh", +# arguments = "-r 3 -t 15 kvm-probes" ] +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# XEN UDP-push Information Driver Manager Configuration # -r number of retries when monitoring a host # -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- @@ -218,13 +271,31 @@ IM_MAD = [ #IM_MAD = [ # name = "xen", # executable = "one_im_ssh", -# arguments = "xen3" ] +# arguments = "-r 3 -t 15 xen3" ] # Driver for Xen 4.x #IM_MAD = [ # name = "xen", # executable = "one_im_ssh", -# arguments = "xen4" ] +# arguments = "-r 3 -t 15 xen4" ] + +#------------------------------------------------------------------------------- +# XEN SSH-pull Information Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time +#------------------------------------------------------------------------------- + +# Driver for Xen 3.x +#IM_MAD = [ +# name = "xen", +# executable = "one_im_ssh", +# arguments = "-r 0 -t 15 xen3-probes" ] + +# Driver for Xen 4.x +#IM_MAD = [ +# name = "xen", +# executable = "one_im_ssh", +# arguments = "-r 0 -t 15 xen4-probes" ] #------------------------------------------------------------------------------- @@ -241,6 +312,8 @@ IM_MAD = [ #------------------------------------------------------------------------------- # EC2 Information Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time #------------------------------------------------------------------------------- #IM_MAD = [ # name = "ec2", @@ -248,6 +321,28 @@ IM_MAD = [ # arguments = "-c -t 1 -r 0 ec2" ] #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# SoftLayer Information Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time +#------------------------------------------------------------------------------- +#IM_MAD = [ +# name = "sl", +# executable = "one_im_sh", +# arguments = "-c -t 1 -r 0 sl" ] +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Azure Information Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time +#------------------------------------------------------------------------------- +#IM_MAD = [ +# name = "az", +# executable = "one_im_sh", +# arguments = "-c -t 1 -r 0 az" ] +#------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # Dummy Information Driver Manager Configuration #------------------------------------------------------------------------------- @@ -348,6 +443,29 @@ VM_MAD = [ # type = "xml" ] #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# SoftLayer Virtualization Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of actions performed at the same time +#------------------------------------------------------------------------------- +#VM_MAD = [ +# name = "sl", +# executable = "one_vmm_sh", +# arguments = "-t 15 -r 0 sl", +# type = "xml" ] +#------------------------------------------------------------------------------- + +# Azure Virtualization Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of actions performed at the same time +#------------------------------------------------------------------------------- +#VM_MAD = [ +# name = "az", +# executable = "one_vmm_sh", +# arguments = "-t 15 -r 0 az", +# type = "xml" ] +#------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # Dummy Virtualization Driver Configuration #------------------------------------------------------------------------------- @@ -368,85 +486,11 @@ VM_MAD = [ name="dummy", executable="one_vmm_dummy", type="xml" ] # -t: number of threads, i.e. number of transfers made at the same time # -d: list of transfer drivers separated by commas, if not defined all the # drivers available will be enabled -# -# The configuration for each driver is defined in TM_MAD_CONF. These -# values are used when creating a new datastore and should not be modified -# since they define the datastore behaviour. -# name : name of the transfer driver, listed in the -d option of the -# TM_MAD section -# ln_target : determines how the persistent images will be cloned when -# a new VM is instantiated. -# NONE: The image will be linked and no more storage capacity will be used -# SELF: The image will be cloned in the Images datastore -# SYSTEM: The image will be cloned in the System datastore -# clone_target : determines how the non persistent images will be -# cloned when a new VM is instantiated. -# NONE: The image will be linked and no more storage capacity will be used -# SELF: The image will be cloned in the Images datastore -# SYSTEM: The image will be cloned in the System datastore -# shared : determines if the storage holding the system datastore is shared -# among the different hosts or not. Valid values: "yes" or "no" #******************************************************************************* TM_MAD = [ executable = "one_tm", - arguments = "-t 15 -d dummy,lvm,shared,shared_lvm,qcow2,ssh,vmfs,ceph" -] - -TM_MAD_CONF = [ - name = "dummy", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "lvm", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "shared", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "shared_lvm", - ln_target = "SYSTEM", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "qcow2", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "ssh", - ln_target = "SYSTEM", - clone_target= "SYSTEM", - shared = "no" -] - -TM_MAD_CONF = [ - name = "vmfs", - ln_target = "NONE", - clone_target= "SYSTEM", - shared = "yes" -] - -TM_MAD_CONF = [ - name = "ceph", - ln_target = "NONE", - clone_target= "SELF", - shared = "yes" + arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph,dev" ] #******************************************************************************* @@ -464,7 +508,7 @@ TM_MAD_CONF = [ DATASTORE_MAD = [ executable = "one_datastore", - arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph" + arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph,dev" ] #******************************************************************************* @@ -650,6 +694,15 @@ SESSION_EXPIRATION_TIME = 900 DEFAULT_UMASK = 177 +#******************************************************************************* +# OneGate +# ONEGATE_ENDPOINT: The URL for the onegate server (the Gate to OpenNebula for +# VMs). The onegate server is started using a separate command. The endpoint +# MUST be consistent with the values in onegate-server.conf +#******************************************************************************* + +#ONEGATE_ENDPOINT = "http://frontend:5030" + #******************************************************************************* # Restricted Attributes Configuration #******************************************************************************* @@ -659,6 +712,16 @@ DEFAULT_UMASK = 177 VM_RESTRICTED_ATTR = "CONTEXT/FILES" VM_RESTRICTED_ATTR = "NIC/MAC" VM_RESTRICTED_ATTR = "NIC/VLAN_ID" +VM_RESTRICTED_ATTR = "NIC/BRIDGE" +VM_RESTRICTED_ATTR = "NIC_DEFAULT/MAC" +VM_RESTRICTED_ATTR = "NIC_DEFAULT/VLAN_ID" +VM_RESTRICTED_ATTR = "NIC_DEFAULT/BRIDGE" +VM_RESTRICTED_ATTR = "DISK/TOTAL_BYTES_SEC" +VM_RESTRICTED_ATTR = "DISK/READ_BYTES_SEC" +VM_RESTRICTED_ATTR = "DISK/WRITE_BYTES_SEC" +VM_RESTRICTED_ATTR = "DISK/TOTAL_IOPS_SEC" +VM_RESTRICTED_ATTR = "DISK/READ_IOPS_SEC" +VM_RESTRICTED_ATTR = "DISK/WRITE_IOPS_SEC" #VM_RESTRICTED_ATTR = "RANK" #VM_RESTRICTED_ATTR = "SCHED_RANK" @@ -668,7 +731,90 @@ VM_RESTRICTED_ATTR = "NIC/VLAN_ID" IMAGE_RESTRICTED_ATTR = "SOURCE" #******************************************************************************* -# OneGate +# Inherited Attributes Configuration +#******************************************************************************* +# The following attributes will be copied from the resource template to the +# instantiated VMs. More than one attribute can be defined. +# +# INHERIT_IMAGE_ATTR: Attribute to be copied from the Image template +# to each VM/DISK. +# +# INHERIT_DATASTORE_ATTR: Attribute to be copied from the Datastore template +# to each VM/DISK. +# +# INHERIT_VNET_ATTR: Attribute to be copied from the Network template +# to each VM/NIC. #******************************************************************************* -#ONEGATE_ENDPOINT = "http://frontend:5030" +#INHERIT_IMAGE_ATTR = "EXAMPLE" +#INHERIT_IMAGE_ATTR = "SECOND_EXAMPLE" +#INHERIT_DATASTORE_ATTR = "COLOR" +#INHERIT_VNET_ATTR = "BANDWIDTH_THROTTLING" + +INHERIT_DATASTORE_ATTR = "CEPH_HOST" +INHERIT_DATASTORE_ATTR = "CEPH_SECRET" +INHERIT_DATASTORE_ATTR = "CEPH_USER" + +INHERIT_DATASTORE_ATTR = "GLUSTER_HOST" +INHERIT_DATASTORE_ATTR = "GLUSTER_VOLUME" + +INHERIT_VNET_ATTR = "VLAN_TAGGED_ID" + +#******************************************************************************* +# Transfer Manager Driver Behavior Configuration +#******************************************************************************* +# The configuration for each driver is defined in TM_MAD_CONF. These +# values are used when creating a new datastore and should not be modified +# since they define the datastore behavior. +# name : name of the transfer driver, listed in the -d option of the +# TM_MAD section +# ln_target : determines how the persistent images will be cloned when +# a new VM is instantiated. +# NONE: The image will be linked and no more storage capacity will be used +# SELF: The image will be cloned in the Images datastore +# SYSTEM: The image will be cloned in the System datastore +# clone_target : determines how the non persistent images will be +# cloned when a new VM is instantiated. +# NONE: The image will be linked and no more storage capacity will be used +# SELF: The image will be cloned in the Images datastore +# SYSTEM: The image will be cloned in the System datastore +# shared : determines if the storage holding the system datastore is shared +# among the different hosts or not. Valid values: "yes" or "no" +#******************************************************************************* + +TM_MAD_CONF = [ + name = "dummy", ln_target = "NONE", clone_target = "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "lvm", ln_target = "NONE", clone_target = "SELF", shared = "yes" +] + +TM_MAD_CONF = [ + name = "shared", ln_target = "NONE", clone_target = "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "fs_lvm", ln_target = "SYSTEM", clone_target = "SYSTEM", shared="yes" +] + +TM_MAD_CONF = [ + name = "qcow2", ln_target = "NONE", clone_target = "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "ssh", ln_target = "SYSTEM", clone_target = "SYSTEM", shared = "no" +] + +TM_MAD_CONF = [ + name = "vmfs", ln_target = "NONE", clone_target= "SYSTEM", shared = "yes" +] + +TM_MAD_CONF = [ + name = "ceph", ln_target = "NONE", clone_target = "SELF", shared = "yes" +] + +TM_MAD_CONF = [ + name = "dev", ln_target = "NONE", clone_target = "NONE", shared = "yes" +] +