1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Merge branch 'master' of git.opennebula.org:one

This commit is contained in:
Tino Vazquez 2011-09-20 16:05:08 +02:00
commit 0c85a849d9
6 changed files with 81 additions and 17 deletions

View File

@ -165,7 +165,8 @@ def install_dependencies(gems, distro)
documentation.
Press enter to continue...
EOT
EOT
STDIN.readline
else
puts "Distribution \"#{distro.first}\" detected."
deps=get_dependencies(gems, distro.last[:dependencies])
@ -240,7 +241,7 @@ packages_string=gems_list.join(' ')
prefix=""
if dist.last[:gem_env]
if dist && dist.last[:gem_env]
prefix=dist.last[:gem_env].collect do |name, value|
"#{name}=\"#{value}\""
end.join(' ')+' '

View File

@ -182,17 +182,27 @@ sleep 3s
mkdir -p results/xml_files
for obj in host vnet image vm user; do
for obj in vnet image vm; do
one$obj list a -x > results/xml_files/$obj-pool.xml
done
for obj in host user; do
one$obj list -x > results/xml_files/$obj-pool.xml
done
for obj in host vnet image vm user; do
for i in 0 1 2 3 4; do
one$obj show -x $i > results/xml_files/$obj-$i.xml
done
done
if [ $TWO_SERIES == "no" ]; then
oneacl list a -x > results/xml_files/acl-pool.xml
onegroup list a -x > results/xml_files/group-pool.xml
oneacl list -x > results/xml_files/acl-pool.xml
onegroup list -x > results/xml_files/group-pool.xml
for i in 0 1; do
onegroup show -x $i > results/xml_files/group-$i.xml
done
fi
# Clean one auth files

View File

@ -57,13 +57,28 @@ pkill -9 -P $PID oned
echo "All resources created, now 2.2 DB will be upgraded."
# dump current DB and schema
onedb backup results/mysqldb.3.0
onedb backup results/mysqldb.3.0 -v
if [ $? -ne 0 ]; then
exit -1
fi
mysqldump -u oneadmin -poneadmin -h localhost -P 0 --no-data onedb_test > results/mysqldb.3.0.tmpschema
if [ $? -ne 0 ]; then
exit -1
fi
# restore 2.2
onedb restore -f 2.2/mysqldb.sql
onedb restore -v -f 2.2/mysqldb.sql
if [ $? -ne 0 ]; then
exit -1
fi
# upgrade
onedb upgrade -v --backup results/mysqldb.backup
if [ $? -ne 0 ]; then
exit -1
fi
# dump upgraded DB schema
mysqldump -u oneadmin -poneadmin -h localhost -P 0 --no-data onedb_test > results/mysqldb.upgraded.tmpschema
@ -104,10 +119,18 @@ for obj in host vnet image vm user; do
done
done
for obj in host vnet image vm acl group user; do
for i in 0 1; do
onegroup show -x $i > results/xml_files/group-$i-upgraded.xml
done
for obj in vnet image vm; do
one$obj list a -x > results/xml_files/$obj-pool-upgraded.xml
done
for obj in host acl group user; do
one$obj list -x > results/xml_files/$obj-pool-upgraded.xml
done
pkill -P $PID oned
sleep 2s;
@ -117,11 +140,8 @@ echo "XML output collected. A diff will be performed."
mkdir results/diff_files
diff <(grep -v -e "<LAST_MON_TIME>" -e "<CLUSTER>" -e "NAME>" results/xml_files/host-pool.xml) <(grep -v -e "<LAST_MON_TIME>" -e "<CLUSTER>" -e "NAME>" results/xml_files/host-pool-upgraded.xml) > results/diff_files/host-pool.diff
# TODO: fix
# The image-pool.xml files are the same, but for some reason the Images are
# returned in different order.
# TODO: fix. The pool elements are returned in different order.
#diff <(grep -v -e "<LAST_MON_TIME>" -e "<CLUSTER>" -e "NAME>" results/xml_files/host-pool.xml) <(grep -v -e "<LAST_MON_TIME>" -e "<CLUSTER>" -e "NAME>" results/xml_files/host-pool-upgraded.xml) > results/diff_files/host-pool.diff
#diff <(grep -v -e "<REGTIME>" -e "<SOURCE>" -e "<SIZE>" results/xml_files/image-pool.xml) <(grep -v -e "<REGTIME>" -e "<SOURCE>" -e "<SIZE>" results/xml_files/image-pool-upgraded.xml) > results/diff_files/image-pool.diff
diff <(grep -v -e "<LAST_POLL>" -e "TIME>" -e "<SOURCE>" -e "<TEMPLATE_ID>" -e "<VM_DIR>" results/xml_files/vm-pool.xml) <(grep -v -e "<LAST_POLL>" -e "TIME>" -e "<SOURCE>" -e "<TEMPLATE_ID>" -e "<VM_DIR>" results/xml_files/vm-pool-upgraded.xml) > results/diff_files/vm-pool.diff
@ -142,6 +162,9 @@ for i in 0 1 2 3 4; do
diff <(cat results/xml_files/user-$i.xml) <(cat results/xml_files/user-$i-upgraded.xml) > results/diff_files/user-$i.diff
done
for i in 0 1; do
diff <(cat results/xml_files/group-$i.xml) <(cat results/xml_files/group-$i-upgraded.xml) > results/diff_files/group-$i.diff
done
CODE=0
@ -155,6 +178,14 @@ for obj in host vnet image vm user; do
done
done
for i in 0 1; do
FILE=results/diff_files/group-$i.diff
if [[ -s $FILE ]] ; then
echo "Error: diff file $FILE is not empty."
CODE=-1
fi
done
for obj in host vnet image vm acl group user; do
FILE=results/diff_files/$obj-pool.diff
if [[ -s $FILE ]] ; then

View File

@ -63,6 +63,10 @@ cp 2.2/one.db results/one.db.upgraded
onedb upgrade -v --sqlite results/one.db.upgraded --backup results/one.db.backup
if [ $? -ne 0 ]; then
exit -1
fi
echo "Done. Upgraded DB and the one just created will be compared."
# Dump both DB schemas
@ -106,10 +110,18 @@ for obj in host vnet image vm user; do
done
done
for obj in host vnet image vm acl group user; do
for i in 0 1; do
onegroup show -x $i > results/xml_files/group-$i-upgraded.xml
done
for obj in vnet image vm; do
one$obj list a -x > results/xml_files/$obj-pool-upgraded.xml
done
for obj in host acl group user; do
one$obj list -x > results/xml_files/$obj-pool-upgraded.xml
done
pkill -P $PID oned
sleep 2s;
@ -139,6 +151,9 @@ for i in 0 1 2 3 4; do
diff <(cat results/xml_files/user-$i.xml) <(cat results/xml_files/user-$i-upgraded.xml) > results/diff_files/user-$i.diff
done
for i in 0 1; do
diff <(cat results/xml_files/group-$i.xml) <(cat results/xml_files/group-$i-upgraded.xml) > results/diff_files/group-$i.diff
done
CODE=0
@ -152,6 +167,14 @@ for obj in host vnet image vm user; do
done
done
for i in 0 1; do
FILE=results/diff_files/group-$i.diff
if [[ -s $FILE ]] ; then
echo "Error: diff file $FILE is not empty."
CODE=-1
fi
done
for obj in host vnet image vm acl group user; do
FILE=results/diff_files/$obj-pool.diff
if [[ -s $FILE ]] ; then

View File

@ -27,7 +27,7 @@ else
OZONES_PID=$ONE_LOCATION/var/ozones.pid
OZONES_LOCATION=$ONE_LOCATION/lib/ozones
OZONES_SERVER=$OZONES_LOCATION/config.ru
OZONES_LOCK_FILE=$ONE_LOCATION/var/.lock
OZONES_LOCK_FILE=$ONE_LOCATION/var/.ozones.lock
OZONES_LOG=$ONE_LOCATION/var/ozones-server.log
OZONES_CONF=$ONE_LOCATION/etc/ozones-server.conf
fi

View File

@ -19,8 +19,7 @@ require 'JSONUtils'
class OzonesServer
include JSONUtils
include OpenNebulaJSON::JSONUtils
def initialize
@ocaInt = OCAInteraction.new