~nova-coresec/ubuntu/maverick/libvirt/nova-ppa

« back to all changes in this revision

Viewing changes to tests/vmx2xmltest.c

  • Committer: Bazaar Package Importer
  • Author(s): Guido Günther
  • Date: 2010-05-09 14:25:00 UTC
  • mto: (1.2.5 upstream) (3.4.15 squeeze)
  • mto: This revision was merged to the branch mainline in revision 92.
  • Revision ID: james.westby@ubuntu.com-20100509142500-1aracjxxmac2zx33
Import upstream version 0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# define MAX_FILE 4096
18
18
 
19
19
static int
20
 
testCompareFiles(const char *vmx, const char *xml, esxVI_APIVersion apiVersion)
 
20
testCompareFiles(const char *vmx, const char *xml,
 
21
                 esxVI_ProductVersion productVersion)
21
22
{
22
23
    int result = -1;
23
24
    char vmxData[MAX_FILE];
37
38
    }
38
39
 
39
40
    def = esxVMX_ParseConfig(NULL, vmxData, "datastore", "directory",
40
 
                             apiVersion);
 
41
                             productVersion);
41
42
 
42
43
    if (def == NULL) {
43
44
        err = virGetLastError();
70
71
struct testInfo {
71
72
    const char *input;
72
73
    const char *output;
73
 
    esxVI_APIVersion version;
 
74
    esxVI_ProductVersion version;
74
75
};
75
76
 
76
77
static int
112
113
        return EXIT_FAILURE;
113
114
    }
114
115
 
115
 
# define DO_TEST(_in, _out, _version)                                      \
 
116
# define DO_TEST(_in, _out, _version)                                         \
116
117
        do {                                                                  \
117
118
            struct testInfo info = { _in, _out, _version };                   \
118
119
            virResetLastError();                                              \
122
123
            }                                                                 \
123
124
        } while (0)
124
125
 
125
 
    DO_TEST("case-insensitive-1", "case-insensitive-1", esxVI_APIVersion_25);
126
 
    DO_TEST("case-insensitive-2", "case-insensitive-2", esxVI_APIVersion_25);
127
 
 
128
 
    DO_TEST("minimal", "minimal", esxVI_APIVersion_25);
129
 
    DO_TEST("minimal-64bit", "minimal-64bit", esxVI_APIVersion_25);
130
 
 
131
 
    DO_TEST("graphics-vnc", "graphics-vnc", esxVI_APIVersion_25);
132
 
 
133
 
    DO_TEST("scsi-driver", "scsi-driver", esxVI_APIVersion_25);
134
 
    DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_APIVersion_25);
135
 
 
136
 
    DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_APIVersion_25);
137
 
    DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_APIVersion_25);
138
 
 
139
 
    DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_APIVersion_25);
140
 
    DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_APIVersion_25);
141
 
    DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_APIVersion_25);
142
 
    DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_APIVersion_25);
143
 
 
144
 
    DO_TEST("floppy-file", "floppy-file", esxVI_APIVersion_25);
145
 
    DO_TEST("floppy-device", "floppy-device", esxVI_APIVersion_25);
146
 
 
147
 
    DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_APIVersion_25);
148
 
 
149
 
    DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25);
150
 
    DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25);
151
 
 
152
 
    DO_TEST("ethernet-generated", "ethernet-generated", esxVI_APIVersion_25);
153
 
    DO_TEST("ethernet-static", "ethernet-static", esxVI_APIVersion_25);
154
 
    DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_APIVersion_25);
155
 
    DO_TEST("ethernet-other", "ethernet-other", esxVI_APIVersion_25);
156
 
 
157
 
    DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25);
158
 
    DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25);
159
 
    DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25);
160
 
    DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_APIVersion_25);
161
 
    DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25);
162
 
    DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_APIVersion_25);
163
 
 
164
 
    DO_TEST("parallel-file", "parallel-file", esxVI_APIVersion_25);
165
 
    DO_TEST("parallel-device", "parallel-device", esxVI_APIVersion_25);
166
 
 
167
 
    DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_APIVersion_25);
168
 
    DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_APIVersion_25);
169
 
    DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_APIVersion_25);
170
 
    DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_APIVersion_25);
171
 
 
172
 
    DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_APIVersion_25);
173
 
    DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_APIVersion_25);
174
 
    DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_APIVersion_25);
175
 
    DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_APIVersion_25);
 
126
    DO_TEST("case-insensitive-1", "case-insensitive-1", esxVI_ProductVersion_ESX35);
 
127
    DO_TEST("case-insensitive-2", "case-insensitive-2", esxVI_ProductVersion_ESX35);
 
128
 
 
129
    DO_TEST("minimal", "minimal", esxVI_ProductVersion_ESX35);
 
130
    DO_TEST("minimal-64bit", "minimal-64bit", esxVI_ProductVersion_ESX35);
 
131
 
 
132
    DO_TEST("graphics-vnc", "graphics-vnc", esxVI_ProductVersion_ESX35);
 
133
 
 
134
    DO_TEST("scsi-driver", "scsi-driver", esxVI_ProductVersion_ESX35);
 
135
    DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_ProductVersion_ESX35);
 
136
 
 
137
    DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_ProductVersion_ESX35);
 
138
    DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_ProductVersion_ESX35);
 
139
 
 
140
    DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_ProductVersion_ESX35);
 
141
    DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_ProductVersion_ESX35);
 
142
    DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_ProductVersion_ESX35);
 
143
    DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_ProductVersion_ESX35);
 
144
 
 
145
    DO_TEST("floppy-file", "floppy-file", esxVI_ProductVersion_ESX35);
 
146
    DO_TEST("floppy-device", "floppy-device", esxVI_ProductVersion_ESX35);
 
147
 
 
148
    DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_ProductVersion_ESX35);
 
149
    DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2", esxVI_ProductVersion_ESX35);
 
150
 
 
151
    DO_TEST("ethernet-custom", "ethernet-custom", esxVI_ProductVersion_ESX35);
 
152
    DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_ProductVersion_ESX35);
 
153
 
 
154
    DO_TEST("ethernet-generated", "ethernet-generated", esxVI_ProductVersion_ESX35);
 
155
    DO_TEST("ethernet-static", "ethernet-static", esxVI_ProductVersion_ESX35);
 
156
    DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_ProductVersion_ESX35);
 
157
    DO_TEST("ethernet-other", "ethernet-other", esxVI_ProductVersion_ESX35);
 
158
 
 
159
    DO_TEST("serial-file", "serial-file", esxVI_ProductVersion_ESX35);
 
160
    DO_TEST("serial-device", "serial-device", esxVI_ProductVersion_ESX35);
 
161
    DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35);
 
162
    DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35);
 
163
    DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35);
 
164
    DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35);
 
165
 
 
166
    DO_TEST("parallel-file", "parallel-file", esxVI_ProductVersion_ESX35);
 
167
    DO_TEST("parallel-device", "parallel-device", esxVI_ProductVersion_ESX35);
 
168
 
 
169
    DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_ProductVersion_ESX35);
 
170
    DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_ProductVersion_ESX35);
 
171
    DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_ProductVersion_ESX35);
 
172
    DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_ProductVersion_ESX35);
 
173
 
 
174
    DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_ProductVersion_ESX35);
 
175
    DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_ProductVersion_ESX35);
 
176
    DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_ProductVersion_ESX35);
 
177
    DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_ProductVersion_ESX35);
176
178
 
177
179
    return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
178
180
}