Merge lp:~pedro/mago/gnome-nettool into lp:~mago-contributors/mago/mago-1.0

Proposed by Pedro Villavicencio
Status: Merged
Merged at revision: 160
Proposed branch: lp:~pedro/mago/gnome-nettool
Merge into: lp:~mago-contributors/mago/mago-1.0
Diff against target: 275 lines (+205/-6)
5 files modified
gnome_nettool/README (+25/-0)
gnome_nettool/gnome_nettool_basics.py (+22/-0)
gnome_nettool/gnome_nettool_basics.xml (+50/-0)
mago/application/gnome_nettool.py (+107/-5)
mago/test_suite/gnome_nettool.py (+1/-1)
To merge this branch: bzr merge lp:~pedro/mago/gnome-nettool
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+45874@code.launchpad.net

Description of the change

* Test Ping.
* Test Traceroute.
* Test Portscan.
* Test Whois.
* Test Netstat:
  * Routing.
  * Active Network Services.
  * Multicast.

Entries might be broken though, same problem as https://bugs.launchpad.net/gnome-utils/+bug/690657 ; which is probably a GTK issue.

To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Looks good. Thanks for your work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gnome_nettool/README'
2--- gnome_nettool/README 2010-11-23 22:02:09 +0000
3+++ gnome_nettool/README 2011-01-11 16:11:53 +0000
4@@ -0,0 +1,25 @@
5+GNOME NETTOOL TESTS
6+====================
7+
8+Safety
9+------
10+
11+The tests are safe to run, they don't touch any system configuration.
12+
13+Configuration
14+-------------
15+
16+The tests don't need any special configuration.
17+
18+Available Tests
19+---------------
20+
21+* Test Ping.
22+* Test Traceroute.
23+* Test Portscan.
24+* Test Whois.
25+* Test Netstat:
26+ * Routing.
27+ * Active Network Services.
28+ * Multicast.
29+
30
31=== modified file 'gnome_nettool/gnome_nettool_basics.py'
32--- gnome_nettool/gnome_nettool_basics.py 2010-11-23 22:02:09 +0000
33+++ gnome_nettool/gnome_nettool_basics.py 2011-01-11 16:11:53 +0000
34@@ -5,6 +5,28 @@
35 from mago.test_suite.gnome_nettool import Gnome_nettoolTestSuite
36
37 class Gnome_nettoolBasics(Gnome_nettoolTestSuite):
38+
39+ def test_ping(self, address):
40+ #this will fail due to bug LP: #663014
41+ if not self.application.gnt_ping(address):
42+ raise AssertionError, 'Ping tool is not working or the host is down.'
43+
44+ def test_traceroute(self, address):
45+ if not self.application.gnt_traceroute(address):
46+ raise AssertionError, 'Traceroute tool is not working or the host is down.'
47+
48+ def test_portscan(self, address):
49+ if not self.application.gnt_portscan(address):
50+ raise AssertionError, 'Portscan tool is not working or the host is down.'
51+
52+ def test_netstat(self, option):
53+ if not self.application.gnt_netstat(option):
54+ raise AssertionError, 'Netstat %s is not working correctly' % (option)
55+
56+ def test_whois(self, domain, dns):
57+ if not self.application.gnt_whois(domain, dns):
58+ raise AssertionError, 'Whois is not working correctly'
59+
60 def testAboutdialog(self, arg1=None):
61 self.application.runAboutdialog()
62
63
64=== modified file 'gnome_nettool/gnome_nettool_basics.xml'
65--- gnome_nettool/gnome_nettool_basics.xml 2010-11-23 22:02:09 +0000
66+++ gnome_nettool/gnome_nettool_basics.xml 2011-01-11 16:11:53 +0000
67@@ -4,6 +4,56 @@
68 <description>
69 Tests which verify Gnome_nettool basics functionality.
70 </description>
71+ <case name="test_ping">
72+ <method>test_ping</method>
73+ <description>Verify that the ping tool works</description>
74+ <args>
75+ <address>127.0.0.1</address>
76+ </args>
77+ </case>
78+ <case name="test_traceroute">
79+ <method>test_traceroute</method>
80+ <description>Verify that the traceroute tool works</description>
81+ <args>
82+ <address>127.0.0.1</address>
83+ </args>
84+ </case>
85+ <case name="test_portscan">
86+ <method>test_portscan</method>
87+ <description>Verify that the portscan tool works</description>
88+ <args>
89+ <address>127.0.0.1</address>
90+ </args>
91+ </case>-->
92+ <case name="test_whois">
93+ <method>test_whois</method>
94+ <description>Verify that the whois tool works</description>
95+ <args>
96+ <domain>ubuntu.com</domain>
97+ <dns>ns1.canonical.com</dns>
98+ </args>
99+ </case>
100+ <case name="netstat_routing">
101+ <method>test_netstat</method>
102+ <description>Verify that the netstat tool works</description>
103+ <args>
104+ <option>ROUTING</option>
105+ </args>
106+ </case>
107+ <case name="netstat_activeservices">
108+ <method>test_netstat</method>
109+ <description>Verify that the netstat active network services works</description>
110+ <args>
111+ <option>NETWORKSERVICES</option>
112+ </args>
113+ </case>
114+ <case name="netstat_multicast">
115+ <method>test_netstat</method>
116+ <description>Verify that the netstat multicast works</description>
117+ <args>
118+ <option>MULTICAST</option>
119+ </args>
120+ </case>
121 <case name="about_dialog">
122 <method>testAboutdialog</method>
123 <description>Verify that the about dialog launches</description>
124
125=== modified file 'mago/application/gnome_nettool.py'
126--- mago/application/gnome_nettool.py 2010-11-23 22:02:09 +0000
127+++ mago/application/gnome_nettool.py 2011-01-11 16:11:53 +0000
128@@ -29,7 +29,7 @@
129
130 LAUNCHER = 'gnome-nettool'
131 LAUNCHER_ARGS = []
132- WINDOW = 'frmDevices*NetworkTools'
133+ WINDOW = 'frm*NetworkTools'
134
135 BTN_CONFIGURE = _('btnConfigure')
136 BTN_FINGER = _('btnFinger')
137@@ -50,7 +50,6 @@
138 MNU_EMPTY1 = _('mnuEmpty1')
139 MNU_EMPTY2 = _('mnuEmpty2')
140 MNU_ETHERNETINTERFACE_ETH0_ = _('mnuEthernetInterface*eth0*')
141- MNU_GETHELPONLINE = _('mnuGetHelpOnline')
142 MNU_HELP1 = _('mnuHelp1')
143 MNU_HOSTNAMEFORADDRESS = _('mnuHostnameforAddress')
144 MNU_INTERNETADDRESS = _('mnuInternetAddress')
145@@ -59,14 +58,117 @@
146 MNU_MAILBOXINFORMATION = _('mnuMailboxInformation')
147 MNU_NAMESERVER = _('mnuNameServer')
148 MNU_QUIT = _('mnuQuit')
149- MNU_REPORTAPROBLEM = _('mnuReportaProblem')
150 MNU_START_OF_AUTHORITY = _('mnuStart*of*authority')
151 MNU_TEXTINFORMATION = _('mnuTextInformation')
152- MNU_TRANSLATETHISAPPLICATION = _('mnuTranslateThisApplication')
153 MNU_WELLKNOWNSERVICES = _('mnuWellKnownServices')
154+ RBTN_ROUTING = _('rbtnRoutingTableInformation')
155+ RBTN_NETWORKSERVICES = _('rbtnActiveNetworkServices')
156+ RBTN_MULTICAST = _('rbtnMulticastInformation')
157+ TBL_PING = _('tbl1')
158+ TBL_TRACEOUTPUT = _('tblTracerouteoutput')
159+ TBL_PORTSCANOUTPUT = _('tblPortscanoutput')
160+ TBL_LOOKUPOUTPUT = _('tblLookupoutput')
161+ TBL_NETSTATOUTPUT = _('tblNetstatoutput')
162+ TXT_DOMAINADDRESS = _('txtDomainaddress')
163+ TXT_PING = _('txtNetworkaddress')
164+ TXT_TRACEROUTE = _('txtNetworkaddress1')
165+ TXT_PORTSCAN = _('txtNetworkaddress2')
166+ TXT_LOOKUP = _('txtNetworkaddress3')
167+ TXT_FINGER_ADDRESS = _('txtNetworkaddress4')
168 TXT_FINGEROUTPUT = _('txtFingeroutput')
169 TXT_WHOISOUTPUT = _('txtWhoisoutput')
170-
171+ PTAB_DEVICES = _('ptabDevices')
172+ PTAB_PING = _('ptabPing')
173+ PTAB_NETSTAT = _('ptabNetstat')
174+ PTAB_TRACEROUTE = _('ptabTraceroute')
175+ PTAB_PORTSCAN = _('ptabPortScan')
176+ PTAB_LOOKUP = _('ptabLookup')
177+ PTAB_FINGER = _('ptabFinger')
178+ PTAB_WHOIS = _('ptabWhois')
179+ PTAB_0 = _('ptl0')
180+
181+ NETSTAT_OPTIONS = {"ROUTING" : RBTN_ROUTING,
182+ "NETWORKSERVICES" : RBTN_NETWORKSERVICES,
183+ "MULTICAST" : RBTN_MULTICAST }
184+
185+ def gnt_ping(self, address):
186+ gnt = ooldtp.context(self.WINDOW)
187+ gnt.selecttab(self.PTAB_0, self.PTAB_PING)
188+ gnt.settextvalue(self.TXT_PING, address)
189+ gnt.getchild(self.BTN_PING).click()
190+ ldtp.wait()
191+ gnt.remap()
192+
193+ if not gnt.guiexist(self.TBL_PING):
194+ return False
195+
196+ if not gnt.getrowcount(self.TBL_PING) > 0:
197+ return False
198+ return True
199+
200+ def gnt_traceroute(self, address):
201+ gnt = ooldtp.context(self.WINDOW)
202+ gnt.selecttab(self.PTAB_0, self.PTAB_TRACEROUTE)
203+ gnt.settextvalue(self.TXT_TRACEROUTE, address)
204+ gnt.getchild(self.BTN_TRACE).click()
205+ ldtp.wait()
206+ gnt.remap()
207+
208+ if not gnt.getrowcount(self.TBL_TRACEOUTPUT) > 0:
209+ return False
210+ return True
211+
212+ def gnt_netstat(self, option):
213+ gnt = ooldtp.context(self.WINDOW)
214+ gnt.selecttab(self.PTAB_0, self.PTAB_NETSTAT)
215+ gnt.getchild(self.NETSTAT_OPTIONS[option]).click()
216+ gnt.getchild(self.BTN_NETSTAT).click()
217+ ldtp.wait()
218+ gnt.remap()
219+
220+ if option == 'MULTICAST':
221+ while gnt.guiexist('btnStop'):
222+ ldtp.wait()
223+ gnt.remap()
224+
225+ if not gnt.getrowcount(self.TBL_NETSTATOUTPUT) > 0:
226+ return False
227+ return True
228+
229+ def gnt_portscan(self, address):
230+ gnt = ooldtp.context(self.WINDOW)
231+ gnt.selecttab(self.PTAB_0, self.PTAB_PORTSCAN)
232+ gnt.settextvalue(self.TXT_PORTSCAN, address)
233+ gnt.getchild(self.BTN_SCAN).click()
234+ ldtp.wait()
235+ gnt.remap()
236+
237+ if not gnt.getrowcount(self.TBL_PORTSCANOUTPUT) > 0:
238+ return False
239+ return True
240+
241+ def gnt_lookup(self, address):
242+ gnt = ooldtp.context(self.WINDOW)
243+ gnt.selecttab(self.PTAB_0, self.PTAB_LOOKUP)
244+ gnt.settextvalue(self.TXT_LOOKUP, address)
245+ gnt.getchild(self.BTN_LOOKUP).click()
246+ ldtp.wait()
247+ gnt.remap()
248+
249+ if not gnt.getrowcount(self.TBL_LOOKUPOUTPUT) > 0:
250+ return False
251+ return True
252+
253+ def gnt_whois(self, domain, dns):
254+ gnt = ooldtp.context(self.WINDOW)
255+ gnt.selecttab(self.PTAB_0, self.PTAB_WHOIS)
256+ gnt.settextvalue(self.TXT_DOMAINADDRESS, domain)
257+ gnt.getchild(self.BTN_WHOIS).click()
258+ ldtp.wait()
259+
260+ if not gnt.getchild(self.TXT_WHOISOUTPUT).verifypartialmatch(dns):
261+ return False
262+ return True
263
264 def runAboutdialog(self):
265 """
266
267=== modified file 'mago/test_suite/gnome_nettool.py'
268--- mago/test_suite/gnome_nettool.py 2010-11-23 22:02:09 +0000
269+++ mago/test_suite/gnome_nettool.py 2011-01-11 16:11:53 +0000
270@@ -17,4 +17,4 @@
271 self.application.close()
272
273 def cleanup(self):
274- self.application.close()
275+ pass

Subscribers

People subscribed via source and target branches

to status/vote changes: