comparison packages/net/ns/dns/current/tests/dns2.c @ 500:b6080ba5b75a

* cdl/dns.cdl: Added the ability to hard code a domain name. Inspired by Motoya Kurotsu. * doc/dns.sgml: Documentation for this. * tests/dns2.c: Verify domain name from the DHCP server with _LOOKUP_DOMAINNAME, not _DNS_IP which is the address of the DNS server. * cdl/dns.cdl: Added the ability to hard code a DNS server address into the image which is used as the default. * doc/dns.sgml: Documentation for this.
author jlarmour
date Sat, 18 Jan 2003 03:47:02 +0000
parents d2c90368aeef
children a0734f51a939
comparison
equal deleted inserted replaced
499:87027e29073d 500:b6080ba5b75a
86 86
87 init_all_network_interfaces(); 87 init_all_network_interfaces();
88 88
89 getdomainname(dn,sizeof(dn)); 89 getdomainname(dn,sizeof(dn));
90 diag_printf("INFO:<DHCP said domain name is %s>\n",dn); 90 diag_printf("INFO:<DHCP said domain name is %s>\n",dn);
91 CYG_TEST_CHECK(!strncmp(dn,_DNS_IP,sizeof(_DNS_IP)), 91 CYG_TEST_CHECK(!strncmp(dn,_LOOKUP_DOMAINNAME,sizeof(_LOOKUP_DOMAINNAME)),
92 "DHCP got the wrong domainname"); 92 "DHCP got the wrong domainname");
93 93
94 /* Expect _LOOKUP_IP as the answer. This is a CNAME lookup */ 94 /* Expect _LOOKUP_IP as the answer. This is a CNAME lookup */
95 inet_aton(_LOOKUP_IP, &addr); 95 inet_aton(_LOOKUP_IP, &addr);
96 hent = gethostbyname(_LOOKUP_FQDN); 96 hent = gethostbyname(_LOOKUP_FQDN);
109 diag_printf("PASS:<%s is %s>\n", _LOOKUP_HOSTNAME, inet_ntoa(*(struct in_addr *)hent->h_addr)); 109 diag_printf("PASS:<%s is %s>\n", _LOOKUP_HOSTNAME, inet_ntoa(*(struct in_addr *)hent->h_addr));
110 } else { 110 } else {
111 diag_printf("FAIL:<Asked for " _LOOKUP_HOSTNAME ". No answer: %s>\n", hstrerror(h_errno)); 111 diag_printf("FAIL:<Asked for " _LOOKUP_HOSTNAME ". No answer: %s>\n", hstrerror(h_errno));
112 } 112 }
113 113
114 CYG_TEST_FINISH("dns1 test completed"); 114 CYG_TEST_FINISH("dns2 test completed");
115 } 115 }
116 116
117 void 117 void
118 cyg_start(void) 118 cyg_start(void)
119 { 119 {