How-to: Test forward and reverse DNS resolution of an host name without an explicit IP address

Overview

This example extends the example How-to: Test forward and reverse DNS resolution of an host name by doing resolution without specifying an target IP address.

Specifying the test case without an IP address

Open the model file for the target environment and write the test case where the ip attribute has the value "":

<?xml version="1.0" encoding="UTF-8"?>
<mmd:models xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:mmd="http://pineapple.dev.java.net/ns/module_model_1_0"                 
  xmlns:ifp="http://pineapple.dev.java.net/ns/plugin/infrastructure_1_0" >
  <mmd:model target-resource="infrastructure-test">             
    <mmd:content>                               
      <itp:infrastructure>                                                                                                      
        
        <itp:dns-resolution-test host="garuda" ip="" description="host garuda resolves to IP ??! and back" />
                                                        
      </itp:infrastructure>                                                                     
    </mmd:content>
  </mmd:model>
</mmd:models>    

When the test case is execute then host name is attempted to be resolved to an IP address. Instead of verifying the resolved IP address against the value of the ip attribute, the test case is content that the resolution didn't fail.

The resolved IP address is used as input in the second part of the test case where it it used to do a reverse DNS lookup to the host name.