PageRenderTime 14ms CodeModel.GetById 12ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/tutorial/net/test_resolver.e

http://github.com/tybor/Liberty
Specman e | 33 lines | 24 code | 5 blank | 4 comment | 4 complexity | e779666198210f0e9f82788f814a8e6d MD5 | raw file
 1class TEST_RESOLVER
 2   --
 3   -- Originally written by Serge Romanchenko <se@sir.nensi.net>
 4   --
 5
 6create {ANY}
 7   make
 8
 9feature {ANY}
10   make
11      local
12         h: LOCALHOST
13      do
14         create h.make
15         io.put_line("Your hostname is: ..... " + h.host_name)
16         io.put_line("Your domainname is: ... " + h.domain_name)
17         io.put_line("So, your FQDN is:...... " + h.fqdn)
18         -- NOTE: only root has permission to do the following :)
19
20         h.set_host_name("newname")
21         if h.last_error /= Void then
22            io.put_line("There was an error while trying to set the new hostname:")
23            io.put_line(h.last_error)
24         end
25
26         h.set_domain_name("new.domain.name")
27         if h.last_error /= Void then
28            io.put_line("There was an error while trying to set the new domainname:")
29            io.put_line(h.last_error)
30         end
31      end
32
33end -- class TEST_RESOLVER