-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcthon2junit.rb
executable file
·110 lines (95 loc) · 3.54 KB
/
cthon2junit.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/ruby
#
# Copyright IBM (2012)
# Author(s): Sean Dague [email protected]
# Jeremy Bongio [email protected]
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# ---------------------------------------
home = ARGV[0]
results = ARGV[1] || "/tmp"
prefix = ARGV[2] || ""
udp = ARGV[3] || "noudp"
krbtested = ARGV[4] || "nokrb"
version = ARGV[5] || "v3"
require "lib/cthon2junit.rb"
# clean up xml files
Dir.chdir(home) do |path|
files = Dir.glob("#{prefix}*.xml")
files.each do |file|
File.delete(file)
end
end
security = []
if krbtested != "nokrb"
security = ["-krb5", "-krb5i", "-krb5p"]
else
security = ['']
end
security.each do |sec|
# Basic
b3t = Cthon::Basic.new("NFS#{version} TCP Basic Tests", "#{results}/nfs#{version}tcp-b#{sec}")
b3t.parse
File.open("#{home}/#{prefix}nfs#{version}tcp-b#{sec}.xml", "w") do |file|
file.write(b3t.testsuite.to_xml)
end
if udp != "noudp"
b3u = Cthon::Basic.new("NFS#{version} UDP Basic Tests", "#{results}/nfs#{version}udp-b#{sec}")
b3u.parse
File.open("#{home}/#{prefix}nfs#{version}udp-b#{sec}.xml", "w") do |file|
file.write(b3u.testsuite.to_xml)
end
end
#General
g3t = Cthon::General.new("NFS#{version} TCP General Tests", "#{results}/nfs#{version}tcp-g#{sec}")
g3t.parse
File.open("#{home}/#{prefix}nfs#{version}tcp-g#{sec}.xml", "w") do |file|
file.write(g3t.testsuite.to_xml)
end
if udp != "noudp"
g3u = Cthon::General.new("NFS#{version} UDP General Tests", "#{results}/nfs#{version}udp-g#{sec}")
g3u.parse
File.open("#{home}/#{prefix}nfs#{version}udp-g#{sec}.xml", "w") do |file|
file.write(g3u.testsuite.to_xml)
end
end
#Special
s3t = Cthon::Special.new("NFS#{version} TCP Special Tests", "#{results}/nfs#{version}tcp-s#{sec}")
s3t.parse
File.open("#{home}/#{prefix}nfs#{version}tcp-s#{sec}.xml", "w") do |file|
file.write(s3t.testsuite.to_xml)
end
if udp != "noudp"
s3u = Cthon::Special.new("NFS#{version} UDP Special Tests", "#{results}/nfs#{version}udp-s#{sec}")
s3u.parse
File.open("#{home}/#{prefix}nfs#{version}udp-s#{sec}.xml", "w") do |file|
file.write(s3u.testsuite.to_xml)
end
end
#Locking
l3t = Cthon::Locking.new("NFS#{version} TCP Locking Tests", "#{results}/nfs#{version}tcp-l#{sec}")
l3t.parse
File.open("#{home}/#{prefix}nfs#{version}tcp-l#{sec}.xml", "w") do |file|
file.write(l3t.testsuite.to_xml)
end
if udp != "noudp"
l3u = Cthon::Locking.new("NFS#{version} UDP Locking Tests", "#{results}/nfs#{version}udp-l#{sec}")
l3u.parse
File.open("#{home}/#{prefix}nfs#{version}udp-l#{sec}.xml", "w") do |file|
file.write(l3u.testsuite.to_xml)
end
end
end