~ubuntu-branches/debian/sid/opennebula/sid

« back to all changes in this revision

Viewing changes to share/doc/xsd/test.sh

  • Committer: Package Import Robot
  • Author(s): Damien Raude-Morvan
  • Date: 2012-05-11 19:27:43 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120511192743-lnz8gog5uxzmx2f3
Tags: 3.4.1-1
* New upstream release:
  - d/patches/default_conf.diff: Drop, transfert manager is now handled
    on a datasatore basis.
  - d/patches/genisoimage.diff: Merged upstream.
  - d/patches/oneacct-system-wide-installation.patch: Merged upstream.
  - Refresh others patches.
  - Update *.install files.
* Improve OCCI Self-Service UI integration:
  - Install into /usr/share/opennebula/occi/.
  - occi_system_jquery.diff: Use system wide jquery/jqueryui.
  - Add Recommends: libjs-jquery, libjs-jquery-ui for opennebula package.
* Add Suggests: ruby-uuidtools for econe-server.
* Install more manpages from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
for i in group_pool group host_pool host image_pool image template_pool template user_pool user vm_pool vm vnet_pool vnet
 
1
#!/bin/bash
 
2
 
 
3
# -------------------------------------------------------------------------- #
 
4
# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)             #
 
5
#                                                                            #
 
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
 
7
# not use this file except in compliance with the License. You may obtain    #
 
8
# a copy of the License at                                                   #
 
9
#                                                                            #
 
10
# http://www.apache.org/licenses/LICENSE-2.0                                 #
 
11
#                                                                            #
 
12
# Unless required by applicable law or agreed to in writing, software        #
 
13
# distributed under the License is distributed on an "AS IS" BASIS,          #
 
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
 
15
# See the License for the specific language governing permissions and        #
 
16
# limitations under the License.                                             #
 
17
#--------------------------------------------------------------------------- #
 
18
 
 
19
mkdir -p samples/cluster    samples/cluster_pool
 
20
mkdir -p samples/datastore  samples/datastore_pool
 
21
mkdir -p samples/group      samples/group_pool
 
22
mkdir -p samples/host       samples/host_pool
 
23
mkdir -p samples/image      samples/image_pool
 
24
mkdir -p samples/vmtemplate samples/vmtemplate_pool
 
25
mkdir -p samples/user       samples/user_pool
 
26
mkdir -p samples/vm         samples/vm_pool
 
27
mkdir -p samples/vnet       samples/vnet_pool
 
28
 
 
29
 
 
30
 
 
31
onecluster create newcluster
 
32
onegroup create newgroup
 
33
 
 
34
 
 
35
# Host
 
36
onehost create host01 --im im_test --vm vmm_test --net dummy
 
37
onehost create host02 --im im_test --vm vmm_test --net dummy
 
38
 
 
39
onecluster addhost newcluster host02
 
40
 
 
41
onehost show 0 -x > samples/host/0.xml
 
42
onehost show 1 -x > samples/host/1.xml
 
43
 
 
44
onehost list -x > samples/host_pool/0.xml
 
45
 
 
46
 
 
47
# VNets
 
48
onevnet list -x > samples/vnet_pool/1.xml
 
49
 
 
50
onevnet create test/vnet.0
 
51
 
 
52
onevnet list -x > samples/vnet_pool/2.xml
 
53
 
 
54
onevnet create test/vnet.1
 
55
onevnet create test/vnet.2
 
56
 
 
57
onecluster addvnet newcluster 0
 
58
onecluster addvnet newcluster 2
 
59
 
 
60
onevnet show 0 -x > samples/vnet/0.xml
 
61
onevnet show 1 -x > samples/vnet/1.xml
 
62
onevnet show 2 -x > samples/vnet/2.xml
 
63
 
 
64
onevnet list -x > samples/vnet_pool/3.xml
 
65
 
 
66
 
 
67
# Template
 
68
onetemplate list -x > samples/vmtemplate_pool/1.xml
 
69
 
 
70
onetemplate create test/template.0
 
71
onetemplate create test/template.1
 
72
 
 
73
onetemplate show 0 -x > samples/vmtemplate/0.xml
 
74
onetemplate show 1 -x > samples/vmtemplate/1.xml
 
75
 
 
76
onetemplate list -x > samples/vmtemplate_pool/2.xml
 
77
 
 
78
 
 
79
# VM
 
80
onetemplate instantiate 0
 
81
 
 
82
onevm show 0 -x > samples/vm/0.xml
 
83
 
 
84
onevm list -x > samples/vm_pool/0.xml
 
85
 
 
86
# Cluster
 
87
onecluster create emptycluster
 
88
 
 
89
onecluster show 100 -x > samples/cluster/0.xml
 
90
onecluster show 101 -x > samples/cluster/1.xml
 
91
 
 
92
onecluster list -x > samples/cluster_pool/0.xml
 
93
 
 
94
 
 
95
# Image
 
96
oneimage list -x > samples/image_pool/1.xml
 
97
 
 
98
oneimage create test/image.0 -d default
 
99
oneimage create test/image.1 -d default
 
100
 
 
101
oneimage show 0 -x > samples/image/0.xml
 
102
oneimage show 1 -x > samples/image/1.xml
 
103
 
 
104
oneimage list -x > samples/image_pool/3.xml
 
105
 
 
106
 
 
107
# Datastore
 
108
onedatastore create test/datastore.0
 
109
onedatastore create test/datastore.1
 
110
 
 
111
onecluster adddatastore newcluster 100
 
112
onecluster adddatastore newcluster 101
 
113
 
 
114
onedatastore show 100 -x > samples/datastore/0.xml
 
115
onedatastore show 101 -x > samples/datastore/1.xml
 
116
 
 
117
onedatastore list -x > samples/datastore_pool/0.xml
 
118
 
 
119
 
 
120
# User
 
121
oneuser create newuser abc
 
122
oneuser chgrp newuser newgroup
 
123
 
 
124
oneuser show newuser -x > samples/user/0.xml
 
125
 
 
126
oneuser list -x > samples/user_pool/0.xml
 
127
 
 
128
 
 
129
# Group
 
130
onegroup create emptygroup
 
131
 
 
132
onegroup show 0 -x > samples/group/0.xml
 
133
onegroup show 1 -x > samples/group/1.xml
 
134
onegroup show 100 -x > samples/group/2.xml
 
135
onegroup show 101 -x > samples/group/3.xml
 
136
 
 
137
onegroup list -x > samples/group_pool/0.xml
 
138
 
 
139
 
 
140
 
 
141
for i in  cluster datastore group host image vmtemplate user vm vnet
3
142
do
 
143
    POOL_NAME="$i""_pool"
 
144
 
 
145
    sed -i "s%<${i^^}>%<${i^^} xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$i.xsd'>%" samples/$i/*.xml
 
146
    sed -i "s%<${i^^}_POOL/>%<${i^^}_POOL xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$POOL_NAME.xsd'/>%" samples/$POOL_NAME/*.xml
 
147
    sed -i "s%<${i^^}_POOL>%<${i^^}_POOL xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../$POOL_NAME.xsd'>%" samples/$POOL_NAME/*.xml
 
148
 
4
149
    xmllint --noout --schema $i.xsd samples/$i/*
5
 
done
 
 
b'\\ No newline at end of file'
 
150
    xmllint --noout --schema $POOL_NAME.xsd samples/$POOL_NAME/*
 
151
done
 
152
 
 
153
exit 0