/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

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