Testing Applications by Using a NIC Proxy Stub
To test an application without NIC, you can configure a NIC proxy stub to take the place of the NIC. The NIC proxy stub comprises a set of explicit mappings of data keys and values in the namespace that contains the NIC proxy properties. When the SDX component passes a specified key to the NIC proxy stub, the NIC proxy stub returns the corresponding value.
For example, you can specify a subscriber's IP address that is associated with a particular SAE. When the SDX component passes this IP address to the NIC proxy stub, the NIC proxy stub returns the corresponding SAE.
Configuring a NIC Proxy Stub from SDX Configuration Editor
When you use a NIC proxy stub, you must also configure test data for the stub to use.
See Configuring the Test Data.
For applications that you can configure through SDX Configuration Editor, such as Dynamic Service Activator, you can configure a NIC proxy stub through the Editor.
To use SDX Configuration Editor to enable and configure a NIC proxy stub:
- In the navigation pane, select a configuration file for the NIC proxy you want to configure.
- Depending on the configuration file, select the NIC proxy tab or the NIC Proxies section on another tab.
- Expand the NIC Proxies section, the section for an individual NIC proxy, and then the Key-Value Pairs When Using NIC Proxy Stub section.
![]()
- In the NIC Proxy Class field, select Yes for NIC Proxy Class, and specify the NIC proxy class for a NIC proxy stub, such as net.juniper.smgt.gateway.gal.proxy.NicProxyStub.
- Under Key-Value Pairs, under the specify the key(s) and value(s) that the proxy is to use in the format key=value and click Add.
- Select File > Save.
- Right-click the configuration file, and select System Configuration > Export to LDAP Directory.
NIC Proxy Stub Fields
In SDX Configuration Editor, you can modify the NIC Proxy Class field and the fields in the Key-Value Pairs When Using NIC Proxy Stub section in a NIC Proxy pane or section of a pane in a configuration file.
NIC Proxy Class
- Specifies whether or not the application uses a specified NIC proxy class rather than an actual NIC proxy.
- Value
- Enable—Enables a specified NIC proxy class for the application.
- Disable—Disables a specified NIC proxy class for the application and enables an actual NIC proxy.
- Guidelines—Enable the specified NIC proxy class. If the NIC proxy class is a value such as net.juniper.smgt.gateway.gal.proxy.NicProxyStub, the NIC proxy stub performs key-value resolutions. Other NIC configuration is not required. A NIC proxy stub is provided for testing purposes.
- Default—No value
Property
Value
- Value to be returned by the NIC proxy stub for a key specified in the Property field.
- Value—<key value>
- Example—SAE IOR
Configuring a NIC Proxy Stub from SDX Admin
When you use a NIC proxy stub, you must also configure test data for the stub to use.
See Configuring the Test Data.
To use SDX Admin to configure a NIC proxy stub:
- In the navigation pane, select the entry for the NIC proxy.
- Add the following line to the NIC proxy properties.
Gateway.nic.NicProxyClassName = net.juniper.smgt.gateway.gal.proxy.NicProxyStubFor example, for Dynamic Service activator, located under l=DynamicServiceActivation, l=WebApplication, ou=staticConfiguration, ou=Configuration, o=Management, o=umc, you would add the lines similar to the following:
/nicProxies/ip/Gateway.nic.NicProxyClassName = net.juniper.smgt.gateway.gal.proxy.NicProxyStub/nicProxies/ip/ANY_KEY = corbaloc::192.2.7.100:8801/SAEConfiguring the Test Data
To use a NIC proxy stub, you configure test data for the NIC proxy to use. You can specify that the test data indicate that any key return a specific SAE or that one or more keys map to particular values. If you specify an explicit SAE for a key, the NIC proxy stub returns the IOR for that SAE, rather than the value defined for the ANY_KEY property.
To configure test data, do one of the following:
See Configuring a NIC Proxy Stub to Use a corbaloc URL to Test Data.
See Configuring a NIC Proxy Stub to Use a File URL to Test Data.
See Configuring a NIC Proxy Stub to Use an IOR to Test Data.
Configuring a NIC Proxy Stub to Use a corbaloc URL to Test Data
To configure a NIC proxy stub to use the corbaloc URL:
- <host>—Name or IP address of the SAE.
- <portNumber>—TCP/IP port number for the SAE. The default is 8801.
For example, corbaloc::127.0.0.1.145:8801/SAE.
- In the NIC proxy configuration, add a line to return any key to a specific SAE or a key that the NIC proxy receives.
To return any key, add a line in the format ANY_KEY=corbaloc::<host>:<port>/SAE
For example, ANY_KEY=corbaloc::sae1:8801/SAE
To specify explicit mapping between keys and values, add lines in the following format to the NIC proxy configuration.
<mapping>=corbaloc::<host>:<port>/SAE
For example, the following test data comprises two subscriber IP addresses associated with different SAEs. You define two explicit mappings:
192.0.2.10 = corbaloc::sae1:8801/SAE
192.0.2.11 = corbaloc::sae2:8801/SAEConfiguring a NIC Proxy Stub to Use a File URL to Test Data
To configure a NIC proxy stub to use the IOR file:
For example, file:///opt/UMC/sae/var/run/sae.ior
- In the NIC proxy configuration, add a line to return any key to a specific SAE or a key that the NIC proxy receives.
To return any key, add a line in the format ANY_KEY=file://<absolute path to the IOR file>.
For example, ANY_KEY=file:///opt/UMC/sae/var/run/sae.ior
To specify explicit mapping between keys and values, add lines in the following format to the NIC proxy configuration.
<mapping>=file://<absolute path to the IOR file>
For example, the following test data comprises two subscriber IP addresses associated with the same SAE. You define two explicit mappings:
192.0.2.0 = file:///opt/UMC/sae/var/run/sae.ior
192.0.2.1 = file:///opt/UMC/sae/var/run/sae.iorConfiguring a NIC Proxy Stub to Use an IOR to Test Data
To configure a NIC proxy stub to use a copy of the IOR:
- Access the sae.ior file in the directory /opt/UMC/sae/var/run.
- Copy the complete IOR of the SAE from this file.
- In the NIC proxy configuration, add a line to return any key to a specific SAE or a key that the NIC proxy receives.
To return any key, add a line in the format ANY_KEY=<SAE_IOR>.
ANY_KEY = IOR:000000000000003549444C3A736D67742E6A756E697065722E6E65742 F7361652F5365727669636541637469766174696F6E456E67696E653A312 E3000000000000000020000000000000070000102000000000D31302E323 2372E312E323031000022610000001B5374616E64617264496D706C4E616 D652F736165504F412F53414500000000020000000000000008000000004 A414300000000010000001C0000000000010001000000010501000100010 1090000000105010001000000010000002C0000000000000001000000010 000001C00000000000100010000000105010001000101090000000105010 001To specify explicit mapping between keys and values, add lines in the following format to the NIC proxy configuration.
For example, the following test data comprises two subscriber IP addresses associated with different SAEs. You can define two explicit mappings:
192.0.2.0 = IOR:000000000000003549444C3A736D67742E6A756E697065722E6E65742 F7361652F5365727669636541637469766174696F6E456E67696E653A312 E3000000000000000020000000000000070000102000000000D31302E323 2372E312E323031000022610000001B5374616E64617264496D706C4E616 D652F736165504F412F53414500000000020000000000000008000000004 A414300000000010000001C0000000000010001000000010501000100010 1090000000105010001000000010000002C0000000000000001000000010 000001C00000000000100010000000105010001000101090000000105010 001192.0.2.1 =IOR:000000000000002438444C3A736D67742E6A756E697065722E6E65742 F7361652F5365727669636541637469766174696F6E456E67696E653A312 E3000000000000000020000000000000070000102000000000D31302E323 2372E312E323031000022610000001B5374616E64617264496D706C4E616 D652F736165504F412F53414500000000020000000000000008000000004 A414300000000010000001C0000000000010001000000010501000100010 1090000000105010001000000010000002C0000000000000001000000010 000001C00000000000100010000000105010001000101090000000105010 001