Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c1b36dc8
authored
Sep 06, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleting old samples
parent
b91c23ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
92 deletions
+0
-92
sample.xml
+0
-37
test.py
+0
-55
No files found.
sample.xml
deleted
100644 → 0
View file @
b91c23ef
<domain
type=
'test'
xmlns:qemu=
'http://libvirt.org/schemas/domain/qemu/1.0'
>
<name>
one-2273
</name>
<vcpu>
1
</vcpu>
<cputune>
<shares>
512
</shares>
</cputune>
<memory>
1048576
</memory>
<os>
<type
arch=
'i686'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<devices>
<emulator>
/usr/bin/kvm
</emulator>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'/datastore/0/2273/disk.0'
/>
<target
dev=
'vda'
/>
<driver
name=
'qemu'
type=
'qcow2'
cache=
'default'
/>
</disk>
<disk
type=
'file'
device=
'cdrom'
>
<source
file=
'/datastore/0/2273/disk.1'
/>
<target
dev=
'hda'
/>
<readonly/>
<driver
name=
'qemu'
type=
'raw'
/>
</disk>
<interface
type=
'ethernet'
>
<target
dev=
'nw-2273-0'
/>
<mac
address=
'02:00:0a:09:01:2d'
/>
<model
type=
'virtio'
/>
</interface>
<graphics
type=
'vnc'
listen=
'0.0.0.0'
port=
'8173'
passwd=
'usxdfmnkfk'
/>
</devices>
<features>
<acpi/>
</features>
<cpu><topology
sockets=
'1'
cores=
'1'
threads=
'1'
/></cpu>
</domain>
test.py
deleted
100755 → 0
View file @
b91c23ef
#!/usr/bin/env python
import
vm
import
vmdriver
#import logging
from
nose.tools
import
raises
graphics
=
{
'type'
:
'vnc'
,
'listen'
:
'0.0.0.0'
,
'port'
:
'6300'
,
'passwd'
:
'asd'
}
a
=
vm
.
VMNetwork
(
name
=
"vm-88"
,
mac
=
"02:00:00:00:00:00"
)
b
=
vm
.
VMDisk
(
name
=
"asd"
,
source
=
'/asdasd/adasds/asd'
)
testvm
=
vm
.
VMInstance
(
name
=
"Thisthename"
,
vcpu
=
"1"
,
memory_max
=
"2048"
,
disk_list
=
[
a
],
network_list
=
[
b
],
graphics
=
graphics
)
netdict
=
{
'name'
:
"vm-88"
,
'mac'
:
"02:00:00:00:00:00"
}
diskdict
=
{
'name'
:
"asd"
,
'source'
:
'/asdasd/adasds/asd'
}
vmdict
=
{
'name'
:
"Thisthename"
,
'vcpu'
:
1
,
'memory_max'
:
2048
,
'disk_list'
:
[
diskdict
],
'network_list'
:
[
netdict
],
'graphics'
:
graphics
}
print
vm
.
VMNetwork
.
deserialize
(
netdict
)
.
dump_xml
()
print
vm
.
VMDisk
.
deserialize
(
diskdict
)
.
dump_xml
()
asd
=
vm
.
VMInstance
.
deserialize
(
vmdict
)
print
asd
.
dump_xml
()
# Enable logging
#logging.basicConfig(filename='example.log', level=logging.DEBUG)
#print testvm.dump_xml()
#vm_driver = vmdriver.VMDriver()
#vm_driver.connect()
#vm_driver.vm_define(testvm)
#print '%(name)s defined.' % {'name': testvm.name}
#for i in vm_driver.list_domains():
# print i
# #vm_driver.vm_start(i)
# vm_driver.vm_undefine(i)
# print '%(name)s undefined.' % {'name': i}
#vm_driver.disconnect()
@raises
(
AttributeError
)
def
test_vm_create_with_None
():
vm_driver
=
vmdriver
.
VMDriver
()
vm_driver
.
connect
()
vm_driver
.
vm_create
(
None
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment