You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Milamber <mi...@apache.org> on 2013/08/08 13:30:58 UTC

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Le 08/08/2013 10:39, sebb@apache.org a ecrit :
> Author: sebb
> Date: Thu Aug  8 10:39:14 2013
> New Revision: 1511681
>
> URL: http://svn.apache.org/r1511681
> Log:
> Support device in addition to source IP address
> Support choice of IPv4 or IPv6; report error if selected interface is not found
> Bugzilla Id: 54874
>
> Modified:
>      jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>      jmeter/trunk/xdocs/usermanual/component_reference.xml
>
> Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java?rev=1511681&r1=1511680&r2=1511681&view=diff
> ==============================================================================
> --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java (original)
> +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java Thu Aug  8 10:39:14 2013
> @@ -21,13 +21,14 @@ package org.apache.jmeter.protocol.http.
>   import java.io.BufferedInputStream;
>   import java.io.IOException;
>   import java.io.InputStream;
> +import java.net.Inet4Address;
> +import java.net.Inet6Address;
>   import java.net.InetAddress;
>   import java.net.InterfaceAddress;
>   import java.net.NetworkInterface;
>   import java.net.SocketException;
>   import java.net.URL;
>   import java.net.UnknownHostException;
> -import java.util.List;
>   
>   import org.apache.jmeter.config.Arguments;
>   import org.apache.jmeter.protocol.http.control.AuthManager;
> @@ -144,7 +145,9 @@ public abstract class HTTPAbstractImpl i
>        * The prefix used to distiguish a device name from a host name.
>        * Host names cannot start with "/".
>        */
> -    private static final String DEVICE_PREFIX = "/dev/";
> +    private static final String DEVICE_PREFIX = "/";


This changes introduce an regression, /dev/eth0 don't works now.



> +    private static final String IPV4 = "ipv4/";
> +    private static final String IPV6 = "ipv6/";
>   
>       /**
>        * Gets the IP source address (IP spoofing) if one has been provided.
> @@ -157,19 +160,32 @@ public abstract class HTTPAbstractImpl i
>           final String ipSource = getIpSource();
>           if (ipSource.length() > 0) {
>               if (ipSource.startsWith(DEVICE_PREFIX)) {
> -                final String device = ipSource.substring(DEVICE_PREFIX.length());
> -                NetworkInterface net = NetworkInterface.getByName(device);
> +                String interfaceName = ipSource.substring(DEVICE_PREFIX.length());


If the the ipSource is "/dev/eth0", the interfaceName become "dev/eth0" 
and generate this error:

java.net.UnknownHostException: Cannot find interface dev/wlan0
     at 
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.getIpSourceAddress(HTTPAbstractImpl.java:184)
     at 
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setupRequest(HTTPHC4Impl.java:671)
     at 
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:269)
     at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
     at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1080)
     at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1069)
     at 
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
     at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
     at java.lang.Thread.run(Thread.java:679)



> +                final Class<? extends InetAddress> ipClass;
> +                if (interfaceName.startsWith(IPV4)) {
> +                    interfaceName = interfaceName.substring(IPV4.length());
> +                    ipClass = Inet4Address.class;
> +                } else if (interfaceName.startsWith(IPV6)) {
> +                    interfaceName = interfaceName.substring(IPV6.length());
> +                    ipClass = Inet6Address.class;
> +                } else {
> +                    ipClass = InetAddress.class;
> +                }
> +                NetworkInterface net = NetworkInterface.getByName(interfaceName);
>                   if (net != null) {
> -                    List<InterfaceAddress> netAds = net.getInterfaceAddresses();
> -                    if (netAds.size() > 0) {
> -                        return netAds.get(0).getAddress();
> +                    for (InterfaceAddress ia : net.getInterfaceAddresses()) {
> +                        final InetAddress inetAddr = ia.getAddress();
> +                        if (ipClass.isInstance(inetAddr)) {
> +                            return inetAddr;
> +                        }
>                       }
> +                    throw new UnknownHostException("Interface " + interfaceName + " does not have address of type " + ipClass.getSimpleName());
>                   }
> -                return null;
> +                throw new UnknownHostException("Cannot find interface " + interfaceName);
>               }
>               return InetAddress.getByName(ipSource);
>           }
> -        return null;
> +        return null; // did not want to spoof the IP address
>       }
>   
>       /**
>
> Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
> URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1511681&r1=1511680&r2=1511681&view=diff
> ==============================================================================
> --- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
> +++ jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Aug  8 10:39:14 2013
> @@ -323,9 +323,11 @@ and send HTTP/HTTPS requests for all ima
>           [Only for HTTP Request HTTPClient]
>           Override the default local IP address for this sample.
>           The JMeter host must have multiple IP addresses (i.e. IP aliases or network interfaces).
> -        The value can be a host name, IP address, or a network interface device such as "eth0" or "le0".
> -        In order to distinguish these from host names, the interface name must be entered with the prefix "/dev/",
> -        for example "/dev/eth0" or "/dev/le0".
> +        The value can be a host name, IP address, or a network interface device such as "eth0" or "lo0".
> +        In order to distinguish these from host names, the interface name must be entered with the prefix "/",
> +        for example "/eth0" or "/lo0". This will pick the first available address for that interface which
> +        this may be either IPV4 or IPV6. To select a specific IP protocol version, prefix the interface name
> +        with "/ipv4/" or "/ipv6/", for example "/ipv4/eth0" or "/ipv6/eth0"
>           If the property <b>httpclient.localaddress</b> is defined, that is used for all HttpClient requests.
>           </property>
>   </properties>
>
>
>


Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Philippe Mouawad <ph...@gmail.com>.
+1 for me

On Friday, August 9, 2013, Milamber wrote:

>
> Le 08/08/2013 20:43, sebb a ecrit :
>
>> [snip]
>> -    private static final String DEVICE_PREFIX = "/dev/";
>> +    private static final String DEVICE_PREFIX = "/";
>>
>>>
>>>>>
>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>
>>>>>  Yes, that was deliberate. I changed the docs accordingly.
>>>>
>>>> You need to use /eth0.
>>>>
>>>
>>> /eth0 don't works, but /ipv4/eth0 works.
>>>
>> That should work - it works for me on Win/XP.
>>
>> Add some debug and see why it's not working.
>>
>>  Seems very complicated to find the good syntax (without read the docs or
>>> with "IP source address" label only)
>>>
>> Where else apart should it be described?
>>
>>  Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>> ipvX
>>> prefix ?
>>>
>> Not sure I understand.
>>
>>  And why not considering if the ipSource (as is) isn't a IP address (4/6),
>>> and not is in the interface's list on host, then it's a hostname, else
>>> return an error.
>>> Therefore it's not necessary to have special prefix to fill the field.
>>>
>> Two issues:
>> - if the interface name is checked first, it will override the
>> identical hostname, which could cause existing tests to fail (not all
>> that likely, but possible)
>> - if the name is not an interface, the check is unnecessary
>>
>> That's why I chose a prefix that cannot be present in a host name.
>>
>
> Ok, in this case, perhaps, a (better?) solution is to provide a combo box
> to allow the user to choice the source address field.
>
> With the combo box, the user could use the common / usual name for their
> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>
> Here a screenshot of HTTP Request with some improvements for reduce the
> width screen size (font changes for the Optional panel and HTTP options) +
> the Src IP combo box.
> http://www.milamberspace.net/**img/http-request-src-addr.png<http://www.milamberspace.net/img/http-request-src-addr.png>
>
> I can commit the UI changes for reduce the minimal width of the HTTP
> Request's pane,
> and if your are agree the changes to add the combo box? (please note, the
> rename of Source IP address field)
>
>
>
>
>
>>
>>>
>>>
>>>  I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix
>>>> to "/".
>>>>
>>>>  +    private static final String IPV4 = "ipv4/";
>>>>>>
>>>>>>  [snip]
>


-- 
Cordialement.
Philippe Mouawad.

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 12 August 2013 15:04, Philippe Mouawad <ph...@gmail.com> wrote:
> Why ?

It's confusing to have completely hidden settings.

> Take Firefox preferences, Tabs are not related to mutually exclusive things.
>
> Even in JMeter, in View Results Tree: Sampler Result, Request and response
> are 3 tabs and not mutually exclusive.

These *are* mutually exclusive - one cannot display them all at once.

> Regards
> Philippe
>
> On Mon, Aug 12, 2013 at 4:01 PM, sebb <se...@gmail.com> wrote:
>
>> On 12 August 2013 14:20, Philippe Mouawad <ph...@gmail.com>
>> wrote:
>> > Look good, but I agree with sebb remarks:
>> >
>> >    - Surround the 2 fields with a line
>> >    - Make default IP/Hostname
>> >
>> > Or maybe another option would be to create tabbed pane:
>>
>> -1
>>
>> Tabbed panes should only be used for mutually exclusive options.
>>
>> >    - one for resource retrieval
>> >    - One for IP Spoofing with these 2 options
>> >    - one for proxy server
>> >    - One for optional tasks (use as monitor, save as MD5 hash)
>> >
>> > IMHO, It would clarify these fields as today they are a kind of "lumber
>> > room" / fourre-tout :-)
>> >
>> > Regards
>> > Philippe
>> >
>> > On Fri, Aug 9, 2013 at 8:25 PM, Milamber <mi...@apache.org> wrote:
>> >
>> >>
>> >> Le 09/08/2013 17:19, sebb a ecrit :
>> >>
>> >>  On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>> >>>
>> >>>> Le 08/08/2013 20:43, sebb a ecrit :
>> >>>>
>> >>>>> [snip]
>> >>>>>
>> >>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>> >>>>> +    private static final String DEVICE_PREFIX = "/";
>> >>>>>
>> >>>>>>
>> >>>>>>>>
>> >>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>> >>>>>>>>
>> >>>>>>>>  Yes, that was deliberate. I changed the docs accordingly.
>> >>>>>>>
>> >>>>>>> You need to use /eth0.
>> >>>>>>>
>> >>>>>>
>> >>>>>> /eth0 don't works, but /ipv4/eth0 works.
>> >>>>>>
>> >>>>> That should work - it works for me on Win/XP.
>> >>>>>
>> >>>>> Add some debug and see why it's not working.
>> >>>>>
>> >>>>>  Seems very complicated to find the good syntax (without read the
>> docs
>> >>>>>> or
>> >>>>>> with "IP source address" label only)
>> >>>>>>
>> >>>>> Where else apart should it be described?
>> >>>>>
>> >>>>>  Why not use a regexp pattern to check IPv4 and IPv6 address?
>> without a
>> >>>>>> ipvX
>> >>>>>> prefix ?
>> >>>>>>
>> >>>>> Not sure I understand.
>> >>>>>
>> >>>>>  And why not considering if the ipSource (as is) isn't a IP address
>> >>>>>> (4/6),
>> >>>>>> and not is in the interface's list on host, then it's a hostname,
>> else
>> >>>>>> return an error.
>> >>>>>> Therefore it's not necessary to have special prefix to fill the
>> field.
>> >>>>>>
>> >>>>> Two issues:
>> >>>>> - if the interface name is checked first, it will override the
>> >>>>> identical hostname, which could cause existing tests to fail (not all
>> >>>>> that likely, but possible)
>> >>>>> - if the name is not an interface, the check is unnecessary
>> >>>>>
>> >>>>> That's why I chose a prefix that cannot be present in a host name.
>> >>>>>
>> >>>>
>> >>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo
>> >>>> box to
>> >>>> allow the user to choice the source address field.
>> >>>>
>> >>> I was trying to avoid increasing the complexity of the GUI.
>> >>>
>> >>> It's a fairly unusual use-case, so I took the view that the user would
>> >>> not mind putting up with a slightly unusual syntax.
>> >>>
>> >>>  With the combo box, the user could use the common / usual name for
>> their
>> >>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>> >>>>
>> >>>> Here a screenshot of HTTP Request with some improvements for reduce
>> the
>> >>>> width screen size (font changes for the Optional panel and HTTP
>> options)
>> >>>> +
>> >>>> the Src IP combo box.
>> >>>> http://www.milamberspace.net/**img/http-request-src-addr.png<
>> http://www.milamberspace.net/img/http-request-src-addr.png>
>> >>>>
>> >>> The IPv4/6 addr entries are ambiguous.
>> >>> Do they apply only to devices?
>> >>> I would hope so, otherwise existing test plans will break.
>> >>> In which case, the entries need to be renamed.
>> >>>
>> >>> The field currently supports Hostname or IP address; it is important
>> >>> that compatibilty is maintained.
>> >>>
>> >>> So the first entry should be for the Hostname/IP addr.
>> >>> The entries need to be something like:
>> >>>
>> >>> Hostname/IP
>> >>> Device
>> >>> Device IPv4
>> >>> Device IPv6
>> >>>
>> >>>  I can commit the UI changes for reduce the minimal width of the HTTP
>> >>>> Request's pane,
>> >>>>
>> >>> Although the GUI is roughly the same width, it is more complicated.
>> >>>
>> >>
>> >> I can reduce the font size (12 to 11 or 10) to reduce more the width for
>> >> the http options.
>> >> Or reduce the text (like removing the 2 "Use" word):
>> >> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ]
>> >> Use multipart/form-data for POST [  ] Browser-compatible headers
>> >>
>> >>
>> >>
>> >>
>> >>>  and if your are agree the changes to add the combo box?
>> >>>>
>> >>> I'm not convinced the change makes it easier for the user.
>> >>> There would be two fields to configure instead of one.
>> >>>
>> >>> The fields should be enclosed in a box so that it is clear they are
>> >>> related.
>> >>> For example, as is done for Web Server & Timeouts.
>> >>>
>> >>> Maybe the "Embedded URLs must match" field should also have a border.
>> >>>
>> >>
>> >> Like this:
>> >> http://www.milamberspace.net/**img/http-request-src-addr-v2.**png<
>> http://www.milamberspace.net/img/http-request-src-addr-v2.png>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>>  (please note, the rename of Source IP address field)
>> >>>>
>> >>> That's OK.
>> >>>
>> >>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>>>
>> >>>>>>  I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>> >>>>>>> prefix
>> >>>>>>> to "/".
>> >>>>>>>
>> >>>>>>>  +    private static final String IPV4 = "ipv4/";
>> >>>>>>>>>
>> >>>>>>>>>  [snip]
>> >>>>
>> >>>
>> >>
>> >
>> >
>> > --
>> > Cordialement.
>> > Philippe Mouawad.
>>
>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Philippe Mouawad <ph...@gmail.com>.
Why ?
Take Firefox preferences, Tabs are not related to mutually exclusive things.

Even in JMeter, in View Results Tree: Sampler Result, Request and response
are 3 tabs and not mutually exclusive.

Regards
Philippe

On Mon, Aug 12, 2013 at 4:01 PM, sebb <se...@gmail.com> wrote:

> On 12 August 2013 14:20, Philippe Mouawad <ph...@gmail.com>
> wrote:
> > Look good, but I agree with sebb remarks:
> >
> >    - Surround the 2 fields with a line
> >    - Make default IP/Hostname
> >
> > Or maybe another option would be to create tabbed pane:
>
> -1
>
> Tabbed panes should only be used for mutually exclusive options.
>
> >    - one for resource retrieval
> >    - One for IP Spoofing with these 2 options
> >    - one for proxy server
> >    - One for optional tasks (use as monitor, save as MD5 hash)
> >
> > IMHO, It would clarify these fields as today they are a kind of "lumber
> > room" / fourre-tout :-)
> >
> > Regards
> > Philippe
> >
> > On Fri, Aug 9, 2013 at 8:25 PM, Milamber <mi...@apache.org> wrote:
> >
> >>
> >> Le 09/08/2013 17:19, sebb a ecrit :
> >>
> >>  On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
> >>>
> >>>> Le 08/08/2013 20:43, sebb a ecrit :
> >>>>
> >>>>> [snip]
> >>>>>
> >>>>> -    private static final String DEVICE_PREFIX = "/dev/";
> >>>>> +    private static final String DEVICE_PREFIX = "/";
> >>>>>
> >>>>>>
> >>>>>>>>
> >>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
> >>>>>>>>
> >>>>>>>>  Yes, that was deliberate. I changed the docs accordingly.
> >>>>>>>
> >>>>>>> You need to use /eth0.
> >>>>>>>
> >>>>>>
> >>>>>> /eth0 don't works, but /ipv4/eth0 works.
> >>>>>>
> >>>>> That should work - it works for me on Win/XP.
> >>>>>
> >>>>> Add some debug and see why it's not working.
> >>>>>
> >>>>>  Seems very complicated to find the good syntax (without read the
> docs
> >>>>>> or
> >>>>>> with "IP source address" label only)
> >>>>>>
> >>>>> Where else apart should it be described?
> >>>>>
> >>>>>  Why not use a regexp pattern to check IPv4 and IPv6 address?
> without a
> >>>>>> ipvX
> >>>>>> prefix ?
> >>>>>>
> >>>>> Not sure I understand.
> >>>>>
> >>>>>  And why not considering if the ipSource (as is) isn't a IP address
> >>>>>> (4/6),
> >>>>>> and not is in the interface's list on host, then it's a hostname,
> else
> >>>>>> return an error.
> >>>>>> Therefore it's not necessary to have special prefix to fill the
> field.
> >>>>>>
> >>>>> Two issues:
> >>>>> - if the interface name is checked first, it will override the
> >>>>> identical hostname, which could cause existing tests to fail (not all
> >>>>> that likely, but possible)
> >>>>> - if the name is not an interface, the check is unnecessary
> >>>>>
> >>>>> That's why I chose a prefix that cannot be present in a host name.
> >>>>>
> >>>>
> >>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo
> >>>> box to
> >>>> allow the user to choice the source address field.
> >>>>
> >>> I was trying to avoid increasing the complexity of the GUI.
> >>>
> >>> It's a fairly unusual use-case, so I took the view that the user would
> >>> not mind putting up with a slightly unusual syntax.
> >>>
> >>>  With the combo box, the user could use the common / usual name for
> their
> >>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
> >>>>
> >>>> Here a screenshot of HTTP Request with some improvements for reduce
> the
> >>>> width screen size (font changes for the Optional panel and HTTP
> options)
> >>>> +
> >>>> the Src IP combo box.
> >>>> http://www.milamberspace.net/**img/http-request-src-addr.png<
> http://www.milamberspace.net/img/http-request-src-addr.png>
> >>>>
> >>> The IPv4/6 addr entries are ambiguous.
> >>> Do they apply only to devices?
> >>> I would hope so, otherwise existing test plans will break.
> >>> In which case, the entries need to be renamed.
> >>>
> >>> The field currently supports Hostname or IP address; it is important
> >>> that compatibilty is maintained.
> >>>
> >>> So the first entry should be for the Hostname/IP addr.
> >>> The entries need to be something like:
> >>>
> >>> Hostname/IP
> >>> Device
> >>> Device IPv4
> >>> Device IPv6
> >>>
> >>>  I can commit the UI changes for reduce the minimal width of the HTTP
> >>>> Request's pane,
> >>>>
> >>> Although the GUI is roughly the same width, it is more complicated.
> >>>
> >>
> >> I can reduce the font size (12 to 11 or 10) to reduce more the width for
> >> the http options.
> >> Or reduce the text (like removing the 2 "Use" word):
> >> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ]
> >> Use multipart/form-data for POST [  ] Browser-compatible headers
> >>
> >>
> >>
> >>
> >>>  and if your are agree the changes to add the combo box?
> >>>>
> >>> I'm not convinced the change makes it easier for the user.
> >>> There would be two fields to configure instead of one.
> >>>
> >>> The fields should be enclosed in a box so that it is clear they are
> >>> related.
> >>> For example, as is done for Web Server & Timeouts.
> >>>
> >>> Maybe the "Embedded URLs must match" field should also have a border.
> >>>
> >>
> >> Like this:
> >> http://www.milamberspace.net/**img/http-request-src-addr-v2.**png<
> http://www.milamberspace.net/img/http-request-src-addr-v2.png>
> >>
> >>
> >>
> >>
> >>
> >>>  (please note, the rename of Source IP address field)
> >>>>
> >>> That's OK.
> >>>
> >>>
> >>>>
> >>>>
> >>>>
> >>>>>>
> >>>>>>  I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
> >>>>>>> prefix
> >>>>>>> to "/".
> >>>>>>>
> >>>>>>>  +    private static final String IPV4 = "ipv4/";
> >>>>>>>>>
> >>>>>>>>>  [snip]
> >>>>
> >>>
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
>



-- 
Cordialement.
Philippe Mouawad.

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 12 August 2013 14:20, Philippe Mouawad <ph...@gmail.com> wrote:
> Look good, but I agree with sebb remarks:
>
>    - Surround the 2 fields with a line
>    - Make default IP/Hostname
>
> Or maybe another option would be to create tabbed pane:

-1

Tabbed panes should only be used for mutually exclusive options.

>    - one for resource retrieval
>    - One for IP Spoofing with these 2 options
>    - one for proxy server
>    - One for optional tasks (use as monitor, save as MD5 hash)
>
> IMHO, It would clarify these fields as today they are a kind of "lumber
> room" / fourre-tout :-)
>
> Regards
> Philippe
>
> On Fri, Aug 9, 2013 at 8:25 PM, Milamber <mi...@apache.org> wrote:
>
>>
>> Le 09/08/2013 17:19, sebb a ecrit :
>>
>>  On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>>>
>>>> Le 08/08/2013 20:43, sebb a ecrit :
>>>>
>>>>> [snip]
>>>>>
>>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>>> +    private static final String DEVICE_PREFIX = "/";
>>>>>
>>>>>>
>>>>>>>>
>>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>>>
>>>>>>>>  Yes, that was deliberate. I changed the docs accordingly.
>>>>>>>
>>>>>>> You need to use /eth0.
>>>>>>>
>>>>>>
>>>>>> /eth0 don't works, but /ipv4/eth0 works.
>>>>>>
>>>>> That should work - it works for me on Win/XP.
>>>>>
>>>>> Add some debug and see why it's not working.
>>>>>
>>>>>  Seems very complicated to find the good syntax (without read the docs
>>>>>> or
>>>>>> with "IP source address" label only)
>>>>>>
>>>>> Where else apart should it be described?
>>>>>
>>>>>  Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>>>>> ipvX
>>>>>> prefix ?
>>>>>>
>>>>> Not sure I understand.
>>>>>
>>>>>  And why not considering if the ipSource (as is) isn't a IP address
>>>>>> (4/6),
>>>>>> and not is in the interface's list on host, then it's a hostname, else
>>>>>> return an error.
>>>>>> Therefore it's not necessary to have special prefix to fill the field.
>>>>>>
>>>>> Two issues:
>>>>> - if the interface name is checked first, it will override the
>>>>> identical hostname, which could cause existing tests to fail (not all
>>>>> that likely, but possible)
>>>>> - if the name is not an interface, the check is unnecessary
>>>>>
>>>>> That's why I chose a prefix that cannot be present in a host name.
>>>>>
>>>>
>>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo
>>>> box to
>>>> allow the user to choice the source address field.
>>>>
>>> I was trying to avoid increasing the complexity of the GUI.
>>>
>>> It's a fairly unusual use-case, so I took the view that the user would
>>> not mind putting up with a slightly unusual syntax.
>>>
>>>  With the combo box, the user could use the common / usual name for their
>>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>>>
>>>> Here a screenshot of HTTP Request with some improvements for reduce the
>>>> width screen size (font changes for the Optional panel and HTTP options)
>>>> +
>>>> the Src IP combo box.
>>>> http://www.milamberspace.net/**img/http-request-src-addr.png<http://www.milamberspace.net/img/http-request-src-addr.png>
>>>>
>>> The IPv4/6 addr entries are ambiguous.
>>> Do they apply only to devices?
>>> I would hope so, otherwise existing test plans will break.
>>> In which case, the entries need to be renamed.
>>>
>>> The field currently supports Hostname or IP address; it is important
>>> that compatibilty is maintained.
>>>
>>> So the first entry should be for the Hostname/IP addr.
>>> The entries need to be something like:
>>>
>>> Hostname/IP
>>> Device
>>> Device IPv4
>>> Device IPv6
>>>
>>>  I can commit the UI changes for reduce the minimal width of the HTTP
>>>> Request's pane,
>>>>
>>> Although the GUI is roughly the same width, it is more complicated.
>>>
>>
>> I can reduce the font size (12 to 11 or 10) to reduce more the width for
>> the http options.
>> Or reduce the text (like removing the 2 "Use" word):
>> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ]
>> Use multipart/form-data for POST [  ] Browser-compatible headers
>>
>>
>>
>>
>>>  and if your are agree the changes to add the combo box?
>>>>
>>> I'm not convinced the change makes it easier for the user.
>>> There would be two fields to configure instead of one.
>>>
>>> The fields should be enclosed in a box so that it is clear they are
>>> related.
>>> For example, as is done for Web Server & Timeouts.
>>>
>>> Maybe the "Embedded URLs must match" field should also have a border.
>>>
>>
>> Like this:
>> http://www.milamberspace.net/**img/http-request-src-addr-v2.**png<http://www.milamberspace.net/img/http-request-src-addr-v2.png>
>>
>>
>>
>>
>>
>>>  (please note, the rename of Source IP address field)
>>>>
>>> That's OK.
>>>
>>>
>>>>
>>>>
>>>>
>>>>>>
>>>>>>  I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>>>>>>> prefix
>>>>>>> to "/".
>>>>>>>
>>>>>>>  +    private static final String IPV4 = "ipv4/";
>>>>>>>>>
>>>>>>>>>  [snip]
>>>>
>>>
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Philippe Mouawad <ph...@gmail.com>.
Look good, but I agree with sebb remarks:

   - Surround the 2 fields with a line
   - Make default IP/Hostname

Or maybe another option would be to create tabbed pane:

   - one for resource retrieval
   - One for IP Spoofing with these 2 options
   - one for proxy server
   - One for optional tasks (use as monitor, save as MD5 hash)

IMHO, It would clarify these fields as today they are a kind of "lumber
room" / fourre-tout :-)


Regards
Philippe

On Fri, Aug 9, 2013 at 8:25 PM, Milamber <mi...@apache.org> wrote:

>
> Le 09/08/2013 17:19, sebb a ecrit :
>
>  On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>>
>>> Le 08/08/2013 20:43, sebb a ecrit :
>>>
>>>> [snip]
>>>>
>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>> +    private static final String DEVICE_PREFIX = "/";
>>>>
>>>>>
>>>>>>>
>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>>
>>>>>>>  Yes, that was deliberate. I changed the docs accordingly.
>>>>>>
>>>>>> You need to use /eth0.
>>>>>>
>>>>>
>>>>> /eth0 don't works, but /ipv4/eth0 works.
>>>>>
>>>> That should work - it works for me on Win/XP.
>>>>
>>>> Add some debug and see why it's not working.
>>>>
>>>>  Seems very complicated to find the good syntax (without read the docs
>>>>> or
>>>>> with "IP source address" label only)
>>>>>
>>>> Where else apart should it be described?
>>>>
>>>>  Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>>>> ipvX
>>>>> prefix ?
>>>>>
>>>> Not sure I understand.
>>>>
>>>>  And why not considering if the ipSource (as is) isn't a IP address
>>>>> (4/6),
>>>>> and not is in the interface's list on host, then it's a hostname, else
>>>>> return an error.
>>>>> Therefore it's not necessary to have special prefix to fill the field.
>>>>>
>>>> Two issues:
>>>> - if the interface name is checked first, it will override the
>>>> identical hostname, which could cause existing tests to fail (not all
>>>> that likely, but possible)
>>>> - if the name is not an interface, the check is unnecessary
>>>>
>>>> That's why I chose a prefix that cannot be present in a host name.
>>>>
>>>
>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo
>>> box to
>>> allow the user to choice the source address field.
>>>
>> I was trying to avoid increasing the complexity of the GUI.
>>
>> It's a fairly unusual use-case, so I took the view that the user would
>> not mind putting up with a slightly unusual syntax.
>>
>>  With the combo box, the user could use the common / usual name for their
>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>>
>>> Here a screenshot of HTTP Request with some improvements for reduce the
>>> width screen size (font changes for the Optional panel and HTTP options)
>>> +
>>> the Src IP combo box.
>>> http://www.milamberspace.net/**img/http-request-src-addr.png<http://www.milamberspace.net/img/http-request-src-addr.png>
>>>
>> The IPv4/6 addr entries are ambiguous.
>> Do they apply only to devices?
>> I would hope so, otherwise existing test plans will break.
>> In which case, the entries need to be renamed.
>>
>> The field currently supports Hostname or IP address; it is important
>> that compatibilty is maintained.
>>
>> So the first entry should be for the Hostname/IP addr.
>> The entries need to be something like:
>>
>> Hostname/IP
>> Device
>> Device IPv4
>> Device IPv6
>>
>>  I can commit the UI changes for reduce the minimal width of the HTTP
>>> Request's pane,
>>>
>> Although the GUI is roughly the same width, it is more complicated.
>>
>
> I can reduce the font size (12 to 11 or 10) to reduce more the width for
> the http options.
> Or reduce the text (like removing the 2 "Use" word):
> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ]
> Use multipart/form-data for POST [  ] Browser-compatible headers
>
>
>
>
>>  and if your are agree the changes to add the combo box?
>>>
>> I'm not convinced the change makes it easier for the user.
>> There would be two fields to configure instead of one.
>>
>> The fields should be enclosed in a box so that it is clear they are
>> related.
>> For example, as is done for Web Server & Timeouts.
>>
>> Maybe the "Embedded URLs must match" field should also have a border.
>>
>
> Like this:
> http://www.milamberspace.net/**img/http-request-src-addr-v2.**png<http://www.milamberspace.net/img/http-request-src-addr-v2.png>
>
>
>
>
>
>>  (please note, the rename of Source IP address field)
>>>
>> That's OK.
>>
>>
>>>
>>>
>>>
>>>>>
>>>>>  I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>>>>>> prefix
>>>>>> to "/".
>>>>>>
>>>>>>  +    private static final String IPV4 = "ipv4/";
>>>>>>>>
>>>>>>>>  [snip]
>>>
>>
>


-- 
Cordialement.
Philippe Mouawad.

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Philippe Mouawad <ph...@gmail.com>.
+1 for http://www.milamberspace.net/img/http-request-src-addr-v3c.png

On Mon, Aug 12, 2013 at 5:37 PM, Milamber <mi...@apache.org> wrote:

>
> Le 12/08/2013 15:00, sebb a ecrit :
>
>  On 9 August 2013 19:25, Milamber <mi...@apache.org> wrote:
>>
>>> Le 09/08/2013 17:19, sebb a ecrit :
>>>
>>>  On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>>>>
>>>>> Le 08/08/2013 20:43, sebb a ecrit :
>>>>>
>>>>>> [snip]
>>>>>>
>>>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>>>> +    private static final String DEVICE_PREFIX = "/";
>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>>>>
>>>>>>>>>  Yes, that was deliberate. I changed the docs accordingly.
>>>>>>>>
>>>>>>>> You need to use /eth0.
>>>>>>>>
>>>>>>>
>>>>>>> /eth0 don't works, but /ipv4/eth0 works.
>>>>>>>
>>>>>> That should work - it works for me on Win/XP.
>>>>>>
>>>>>> Add some debug and see why it's not working.
>>>>>>
>>>>>>  Seems very complicated to find the good syntax (without read the docs
>>>>>>> or
>>>>>>> with "IP source address" label only)
>>>>>>>
>>>>>> Where else apart should it be described?
>>>>>>
>>>>>>  Why not use a regexp pattern to check IPv4 and IPv6 address? without
>>>>>>> a
>>>>>>> ipvX
>>>>>>> prefix ?
>>>>>>>
>>>>>> Not sure I understand.
>>>>>>
>>>>>>  And why not considering if the ipSource (as is) isn't a IP address
>>>>>>> (4/6),
>>>>>>> and not is in the interface's list on host, then it's a hostname,
>>>>>>> else
>>>>>>> return an error.
>>>>>>> Therefore it's not necessary to have special prefix to fill the
>>>>>>> field.
>>>>>>>
>>>>>> Two issues:
>>>>>> - if the interface name is checked first, it will override the
>>>>>> identical hostname, which could cause existing tests to fail (not all
>>>>>> that likely, but possible)
>>>>>> - if the name is not an interface, the check is unnecessary
>>>>>>
>>>>>> That's why I chose a prefix that cannot be present in a host name.
>>>>>>
>>>>>
>>>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo
>>>>> box
>>>>> to
>>>>> allow the user to choice the source address field.
>>>>>
>>>> I was trying to avoid increasing the complexity of the GUI.
>>>>
>>>> It's a fairly unusual use-case, so I took the view that the user would
>>>> not mind putting up with a slightly unusual syntax.
>>>>
>>>>  With the combo box, the user could use the common / usual name for
>>>>> their
>>>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>>>>
>>>>> Here a screenshot of HTTP Request with some improvements for reduce the
>>>>> width screen size (font changes for the Optional panel and HTTP
>>>>> options)
>>>>> +
>>>>> the Src IP combo box.
>>>>> http://www.milamberspace.net/**img/http-request-src-addr.png<http://www.milamberspace.net/img/http-request-src-addr.png>
>>>>>
>>>> The IPv4/6 addr entries are ambiguous.
>>>> Do they apply only to devices?
>>>> I would hope so, otherwise existing test plans will break.
>>>> In which case, the entries need to be renamed.
>>>>
>>>> The field currently supports Hostname or IP address; it is important
>>>> that compatibilty is maintained.
>>>>
>>>> So the first entry should be for the Hostname/IP addr.
>>>> The entries need to be something like:
>>>>
>>>> Hostname/IP
>>>> Device
>>>> Device IPv4
>>>> Device IPv6
>>>>
>>>>  I can commit the UI changes for reduce the minimal width of the HTTP
>>>>> Request's pane,
>>>>>
>>>> Although the GUI is roughly the same width, it is more complicated.
>>>>
>>>
>>> I can reduce the font size (12 to 11 or 10) to reduce more the width for
>>> the
>>> http options.
>>> Or reduce the text (like removing the 2 "Use" word):
>>> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ]
>>> Use
>>> multipart/form-data for POST [  ] Browser-compatible headers
>>>
>>>
>>>
>>>  and if your are agree the changes to add the combo box?
>>>>>
>>>> I'm not convinced the change makes it easier for the user.
>>>> There would be two fields to configure instead of one.
>>>>
>>>> The fields should be enclosed in a box so that it is clear they are
>>>> related.
>>>> For example, as is done for Web Server & Timeouts.
>>>>
>>>> Maybe the "Embedded URLs must match" field should also have a border.
>>>>
>>>
>>> Like this:
>>> http://www.milamberspace.net/**img/http-request-src-addr-v2.**png<http://www.milamberspace.net/img/http-request-src-addr-v2.png>
>>>
>> Not quite.
>>
>> Embedded URLs is also an optional task. Whether we still need that
>> heading or not is another matter.
>> But it's wrong to exclude them from the heading if it is present.
>>
>> It's good to have all the embedded stuff in a single box.
>> But the source address and associated drop-down must also be in their own
>> box.
>>
>
> See:
> http://www.milamberspace.net/**img/http-request-src-addr-v3a.**png<http://www.milamberspace.net/img/http-request-src-addr-v3a.png>
> or
> http://www.milamberspace.net/**img/http-request-src-addr-v3b.**png<http://www.milamberspace.net/img/http-request-src-addr-v3b.png>
> or
> http://www.milamberspace.net/**img/http-request-src-addr-v3c.**png<http://www.milamberspace.net/img/http-request-src-addr-v3c.png>
> or
> http://www.milamberspace.net/**img/http-request-src-addr-v3d.**png<http://www.milamberspace.net/img/http-request-src-addr-v3d.png>
>
> 3c seems be the best UI?
>
>
>
>
>
>>
>>>
>>>  (please note, the rename of Source IP address field)
>>>>>
>>>> That's OK.
>>>>
>>>>
>>>>>
>>>>>
>>>>>>>  I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>>>>>>>> prefix
>>>>>>>> to "/".
>>>>>>>>
>>>>>>>>  +    private static final String IPV4 = "ipv4/";
>>>>>>>>>>
>>>>>>>>>>  [snip]
>>>>>
>>>>
>>>  .
>>
>>
>


-- 
Cordialement.
Philippe Mouawad.

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 12 August 2013 16:37, Milamber <mi...@apache.org> wrote:
>
> Le 12/08/2013 15:00, sebb a ecrit :
>
>> On 9 August 2013 19:25, Milamber <mi...@apache.org> wrote:
>>>
>>> Le 09/08/2013 17:19, sebb a ecrit :
>>>
>>>> On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>>>>>
>>>>> Le 08/08/2013 20:43, sebb a ecrit :
>>>>>>
>>>>>> [snip]
>>>>>>
>>>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>>>> +    private static final String DEVICE_PREFIX = "/";
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>>>>
>>>>>>>> Yes, that was deliberate. I changed the docs accordingly.
>>>>>>>>
>>>>>>>> You need to use /eth0.
>>>>>>>
>>>>>>>
>>>>>>> /eth0 don't works, but /ipv4/eth0 works.
>>>>>>
>>>>>> That should work - it works for me on Win/XP.
>>>>>>
>>>>>> Add some debug and see why it's not working.
>>>>>>
>>>>>>> Seems very complicated to find the good syntax (without read the docs
>>>>>>> or
>>>>>>> with "IP source address" label only)
>>>>>>
>>>>>> Where else apart should it be described?
>>>>>>
>>>>>>> Why not use a regexp pattern to check IPv4 and IPv6 address? without
>>>>>>> a
>>>>>>> ipvX
>>>>>>> prefix ?
>>>>>>
>>>>>> Not sure I understand.
>>>>>>
>>>>>>> And why not considering if the ipSource (as is) isn't a IP address
>>>>>>> (4/6),
>>>>>>> and not is in the interface's list on host, then it's a hostname,
>>>>>>> else
>>>>>>> return an error.
>>>>>>> Therefore it's not necessary to have special prefix to fill the
>>>>>>> field.
>>>>>>
>>>>>> Two issues:
>>>>>> - if the interface name is checked first, it will override the
>>>>>> identical hostname, which could cause existing tests to fail (not all
>>>>>> that likely, but possible)
>>>>>> - if the name is not an interface, the check is unnecessary
>>>>>>
>>>>>> That's why I chose a prefix that cannot be present in a host name.
>>>>>
>>>>>
>>>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo
>>>>> box
>>>>> to
>>>>> allow the user to choice the source address field.
>>>>
>>>> I was trying to avoid increasing the complexity of the GUI.
>>>>
>>>> It's a fairly unusual use-case, so I took the view that the user would
>>>> not mind putting up with a slightly unusual syntax.
>>>>
>>>>> With the combo box, the user could use the common / usual name for
>>>>> their
>>>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>>>>
>>>>> Here a screenshot of HTTP Request with some improvements for reduce the
>>>>> width screen size (font changes for the Optional panel and HTTP
>>>>> options)
>>>>> +
>>>>> the Src IP combo box.
>>>>> http://www.milamberspace.net/img/http-request-src-addr.png
>>>>
>>>> The IPv4/6 addr entries are ambiguous.
>>>> Do they apply only to devices?
>>>> I would hope so, otherwise existing test plans will break.
>>>> In which case, the entries need to be renamed.
>>>>
>>>> The field currently supports Hostname or IP address; it is important
>>>> that compatibilty is maintained.
>>>>
>>>> So the first entry should be for the Hostname/IP addr.
>>>> The entries need to be something like:
>>>>
>>>> Hostname/IP
>>>> Device
>>>> Device IPv4
>>>> Device IPv6
>>>>
>>>>> I can commit the UI changes for reduce the minimal width of the HTTP
>>>>> Request's pane,
>>>>
>>>> Although the GUI is roughly the same width, it is more complicated.
>>>
>>>
>>> I can reduce the font size (12 to 11 or 10) to reduce more the width for
>>> the
>>> http options.
>>> Or reduce the text (like removing the 2 "Use" word):
>>> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ]
>>> Use
>>> multipart/form-data for POST [  ] Browser-compatible headers
>>>
>>>
>>>
>>>>> and if your are agree the changes to add the combo box?
>>>>
>>>> I'm not convinced the change makes it easier for the user.
>>>> There would be two fields to configure instead of one.
>>>>
>>>> The fields should be enclosed in a box so that it is clear they are
>>>> related.
>>>> For example, as is done for Web Server & Timeouts.
>>>>
>>>> Maybe the "Embedded URLs must match" field should also have a border.
>>>
>>>
>>> Like this:
>>> http://www.milamberspace.net/img/http-request-src-addr-v2.png
>>
>> Not quite.
>>
>> Embedded URLs is also an optional task. Whether we still need that
>> heading or not is another matter.
>> But it's wrong to exclude them from the heading if it is present.
>>
>> It's good to have all the embedded stuff in a single box.
>> But the source address and associated drop-down must also be in their own
>> box.
>
>
> See:
> http://www.milamberspace.net/img/http-request-src-addr-v3a.png
> or
> http://www.milamberspace.net/img/http-request-src-addr-v3b.png
> or
> http://www.milamberspace.net/img/http-request-src-addr-v3c.png
> or
> http://www.milamberspace.net/img/http-request-src-addr-v3d.png
>
> 3c seems be the best UI?

3c (but 3d is OK too).

>
>
>
>>
>>>
>>>
>>>>> (please note, the rename of Source IP address field)
>>>>
>>>> That's OK.
>>>>
>>>>>
>>>>>
>>>>>>>
>>>>>>>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>>>>>>>> prefix
>>>>>>>> to "/".
>>>>>>>>
>>>>>>>>>> +    private static final String IPV4 = "ipv4/";
>>>>>>>>>>
>>>>> [snip]
>>>
>>>
>> .
>>
>

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Milamber <mi...@apache.org>.
Le 12/08/2013 15:00, sebb a ecrit :
> On 9 August 2013 19:25, Milamber <mi...@apache.org> wrote:
>> Le 09/08/2013 17:19, sebb a ecrit :
>>
>>> On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>>>> Le 08/08/2013 20:43, sebb a ecrit :
>>>>> [snip]
>>>>>
>>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>>> +    private static final String DEVICE_PREFIX = "/";
>>>>>>>>
>>>>>>>>
>>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>>>
>>>>>>> Yes, that was deliberate. I changed the docs accordingly.
>>>>>>>
>>>>>>> You need to use /eth0.
>>>>>>
>>>>>> /eth0 don't works, but /ipv4/eth0 works.
>>>>> That should work - it works for me on Win/XP.
>>>>>
>>>>> Add some debug and see why it's not working.
>>>>>
>>>>>> Seems very complicated to find the good syntax (without read the docs
>>>>>> or
>>>>>> with "IP source address" label only)
>>>>> Where else apart should it be described?
>>>>>
>>>>>> Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>>>>> ipvX
>>>>>> prefix ?
>>>>> Not sure I understand.
>>>>>
>>>>>> And why not considering if the ipSource (as is) isn't a IP address
>>>>>> (4/6),
>>>>>> and not is in the interface's list on host, then it's a hostname, else
>>>>>> return an error.
>>>>>> Therefore it's not necessary to have special prefix to fill the field.
>>>>> Two issues:
>>>>> - if the interface name is checked first, it will override the
>>>>> identical hostname, which could cause existing tests to fail (not all
>>>>> that likely, but possible)
>>>>> - if the name is not an interface, the check is unnecessary
>>>>>
>>>>> That's why I chose a prefix that cannot be present in a host name.
>>>>
>>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo box
>>>> to
>>>> allow the user to choice the source address field.
>>> I was trying to avoid increasing the complexity of the GUI.
>>>
>>> It's a fairly unusual use-case, so I took the view that the user would
>>> not mind putting up with a slightly unusual syntax.
>>>
>>>> With the combo box, the user could use the common / usual name for their
>>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>>>
>>>> Here a screenshot of HTTP Request with some improvements for reduce the
>>>> width screen size (font changes for the Optional panel and HTTP options)
>>>> +
>>>> the Src IP combo box.
>>>> http://www.milamberspace.net/img/http-request-src-addr.png
>>> The IPv4/6 addr entries are ambiguous.
>>> Do they apply only to devices?
>>> I would hope so, otherwise existing test plans will break.
>>> In which case, the entries need to be renamed.
>>>
>>> The field currently supports Hostname or IP address; it is important
>>> that compatibilty is maintained.
>>>
>>> So the first entry should be for the Hostname/IP addr.
>>> The entries need to be something like:
>>>
>>> Hostname/IP
>>> Device
>>> Device IPv4
>>> Device IPv6
>>>
>>>> I can commit the UI changes for reduce the minimal width of the HTTP
>>>> Request's pane,
>>> Although the GUI is roughly the same width, it is more complicated.
>>
>> I can reduce the font size (12 to 11 or 10) to reduce more the width for the
>> http options.
>> Or reduce the text (like removing the 2 "Use" word):
>> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ] Use
>> multipart/form-data for POST [  ] Browser-compatible headers
>>
>>
>>
>>>> and if your are agree the changes to add the combo box?
>>> I'm not convinced the change makes it easier for the user.
>>> There would be two fields to configure instead of one.
>>>
>>> The fields should be enclosed in a box so that it is clear they are
>>> related.
>>> For example, as is done for Web Server & Timeouts.
>>>
>>> Maybe the "Embedded URLs must match" field should also have a border.
>>
>> Like this:
>> http://www.milamberspace.net/img/http-request-src-addr-v2.png
> Not quite.
>
> Embedded URLs is also an optional task. Whether we still need that
> heading or not is another matter.
> But it's wrong to exclude them from the heading if it is present.
>
> It's good to have all the embedded stuff in a single box.
> But the source address and associated drop-down must also be in their own box.

See:
http://www.milamberspace.net/img/http-request-src-addr-v3a.png
or
http://www.milamberspace.net/img/http-request-src-addr-v3b.png
or
http://www.milamberspace.net/img/http-request-src-addr-v3c.png
or
http://www.milamberspace.net/img/http-request-src-addr-v3d.png

3c seems be the best UI?




>
>>
>>
>>>> (please note, the rename of Source IP address field)
>>> That's OK.
>>>
>>>>
>>>>
>>>>>>
>>>>>>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>>>>>>> prefix
>>>>>>> to "/".
>>>>>>>
>>>>>>>>> +    private static final String IPV4 = "ipv4/";
>>>>>>>>>
>>>> [snip]
>>
> .
>


Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 9 August 2013 19:25, Milamber <mi...@apache.org> wrote:
>
> Le 09/08/2013 17:19, sebb a ecrit :
>
>> On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>>>
>>> Le 08/08/2013 20:43, sebb a ecrit :
>>>>
>>>> [snip]
>>>>
>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>> +    private static final String DEVICE_PREFIX = "/";
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>>
>>>>>> Yes, that was deliberate. I changed the docs accordingly.
>>>>>>
>>>>>> You need to use /eth0.
>>>>>
>>>>>
>>>>> /eth0 don't works, but /ipv4/eth0 works.
>>>>
>>>> That should work - it works for me on Win/XP.
>>>>
>>>> Add some debug and see why it's not working.
>>>>
>>>>> Seems very complicated to find the good syntax (without read the docs
>>>>> or
>>>>> with "IP source address" label only)
>>>>
>>>> Where else apart should it be described?
>>>>
>>>>> Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>>>> ipvX
>>>>> prefix ?
>>>>
>>>> Not sure I understand.
>>>>
>>>>> And why not considering if the ipSource (as is) isn't a IP address
>>>>> (4/6),
>>>>> and not is in the interface's list on host, then it's a hostname, else
>>>>> return an error.
>>>>> Therefore it's not necessary to have special prefix to fill the field.
>>>>
>>>> Two issues:
>>>> - if the interface name is checked first, it will override the
>>>> identical hostname, which could cause existing tests to fail (not all
>>>> that likely, but possible)
>>>> - if the name is not an interface, the check is unnecessary
>>>>
>>>> That's why I chose a prefix that cannot be present in a host name.
>>>
>>>
>>> Ok, in this case, perhaps, a (better?) solution is to provide a combo box
>>> to
>>> allow the user to choice the source address field.
>>
>> I was trying to avoid increasing the complexity of the GUI.
>>
>> It's a fairly unusual use-case, so I took the view that the user would
>> not mind putting up with a slightly unusual syntax.
>>
>>> With the combo box, the user could use the common / usual name for their
>>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>>
>>> Here a screenshot of HTTP Request with some improvements for reduce the
>>> width screen size (font changes for the Optional panel and HTTP options)
>>> +
>>> the Src IP combo box.
>>> http://www.milamberspace.net/img/http-request-src-addr.png
>>
>> The IPv4/6 addr entries are ambiguous.
>> Do they apply only to devices?
>> I would hope so, otherwise existing test plans will break.
>> In which case, the entries need to be renamed.
>>
>> The field currently supports Hostname or IP address; it is important
>> that compatibilty is maintained.
>>
>> So the first entry should be for the Hostname/IP addr.
>> The entries need to be something like:
>>
>> Hostname/IP
>> Device
>> Device IPv4
>> Device IPv6
>>
>>> I can commit the UI changes for reduce the minimal width of the HTTP
>>> Request's pane,
>>
>> Although the GUI is roughly the same width, it is more complicated.
>
>
> I can reduce the font size (12 to 11 or 10) to reduce more the width for the
> http options.
> Or reduce the text (like removing the 2 "Use" word):
> [  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ] Use
> multipart/form-data for POST [  ] Browser-compatible headers
>
>
>
>>
>>> and if your are agree the changes to add the combo box?
>>
>> I'm not convinced the change makes it easier for the user.
>> There would be two fields to configure instead of one.
>>
>> The fields should be enclosed in a box so that it is clear they are
>> related.
>> For example, as is done for Web Server & Timeouts.
>>
>> Maybe the "Embedded URLs must match" field should also have a border.
>
>
> Like this:
> http://www.milamberspace.net/img/http-request-src-addr-v2.png

Not quite.

Embedded URLs is also an optional task. Whether we still need that
heading or not is another matter.
But it's wrong to exclude them from the heading if it is present.

It's good to have all the embedded stuff in a single box.
But the source address and associated drop-down must also be in their own box.

>
>
>
>>
>>> (please note, the rename of Source IP address field)
>>
>> That's OK.
>>
>>>
>>>
>>>
>>>>>
>>>>>
>>>>>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the
>>>>>> prefix
>>>>>> to "/".
>>>>>>
>>>>>>>> +    private static final String IPV4 = "ipv4/";
>>>>>>>>
>>> [snip]
>
>

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Milamber <mi...@apache.org>.
Le 09/08/2013 17:19, sebb a ecrit :
> On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>> Le 08/08/2013 20:43, sebb a ecrit :
>>> [snip]
>>>
>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>> +    private static final String DEVICE_PREFIX = "/";
>>>>>>
>>>>>>
>>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>>
>>>>> Yes, that was deliberate. I changed the docs accordingly.
>>>>>
>>>>> You need to use /eth0.
>>>>
>>>> /eth0 don't works, but /ipv4/eth0 works.
>>> That should work - it works for me on Win/XP.
>>>
>>> Add some debug and see why it's not working.
>>>
>>>> Seems very complicated to find the good syntax (without read the docs or
>>>> with "IP source address" label only)
>>> Where else apart should it be described?
>>>
>>>> Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>>> ipvX
>>>> prefix ?
>>> Not sure I understand.
>>>
>>>> And why not considering if the ipSource (as is) isn't a IP address (4/6),
>>>> and not is in the interface's list on host, then it's a hostname, else
>>>> return an error.
>>>> Therefore it's not necessary to have special prefix to fill the field.
>>> Two issues:
>>> - if the interface name is checked first, it will override the
>>> identical hostname, which could cause existing tests to fail (not all
>>> that likely, but possible)
>>> - if the name is not an interface, the check is unnecessary
>>>
>>> That's why I chose a prefix that cannot be present in a host name.
>>
>> Ok, in this case, perhaps, a (better?) solution is to provide a combo box to
>> allow the user to choice the source address field.
> I was trying to avoid increasing the complexity of the GUI.
>
> It's a fairly unusual use-case, so I took the view that the user would
> not mind putting up with a slightly unusual syntax.
>
>> With the combo box, the user could use the common / usual name for their
>> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>>
>> Here a screenshot of HTTP Request with some improvements for reduce the
>> width screen size (font changes for the Optional panel and HTTP options) +
>> the Src IP combo box.
>> http://www.milamberspace.net/img/http-request-src-addr.png
> The IPv4/6 addr entries are ambiguous.
> Do they apply only to devices?
> I would hope so, otherwise existing test plans will break.
> In which case, the entries need to be renamed.
>
> The field currently supports Hostname or IP address; it is important
> that compatibilty is maintained.
>
> So the first entry should be for the Hostname/IP addr.
> The entries need to be something like:
>
> Hostname/IP
> Device
> Device IPv4
> Device IPv6
>
>> I can commit the UI changes for reduce the minimal width of the HTTP
>> Request's pane,
> Although the GUI is roughly the same width, it is more complicated.

I can reduce the font size (12 to 11 or 10) to reduce more the width for 
the http options.
Or reduce the text (like removing the 2 "Use" word):
[  ] Redirect Automatically [  ] Floww Redirects [  ] Use KeepAlive [  ] 
Use multipart/form-data for POST [  ] Browser-compatible headers


>
>> and if your are agree the changes to add the combo box?
> I'm not convinced the change makes it easier for the user.
> There would be two fields to configure instead of one.
>
> The fields should be enclosed in a box so that it is clear they are related.
> For example, as is done for Web Server & Timeouts.
>
> Maybe the "Embedded URLs must match" field should also have a border.

Like this:
http://www.milamberspace.net/img/http-request-src-addr-v2.png



>
>> (please note, the rename of Source IP address field)
> That's OK.
>
>>
>>
>>
>>>>
>>>>
>>>>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix
>>>>> to "/".
>>>>>
>>>>>>> +    private static final String IPV4 = "ipv4/";
>>>>>>>
>> [snip]


Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 9 August 2013 10:43, Milamber <mi...@apache.org> wrote:
>
> Le 08/08/2013 20:43, sebb a ecrit :
>>
>> [snip]
>>
>> -    private static final String DEVICE_PREFIX = "/dev/";
>> +    private static final String DEVICE_PREFIX = "/";
>>>>>
>>>>>
>>>>>
>>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>>
>>>> Yes, that was deliberate. I changed the docs accordingly.
>>>>
>>>> You need to use /eth0.
>>>
>>>
>>> /eth0 don't works, but /ipv4/eth0 works.
>>
>> That should work - it works for me on Win/XP.
>>
>> Add some debug and see why it's not working.
>>
>>> Seems very complicated to find the good syntax (without read the docs or
>>> with "IP source address" label only)
>>
>> Where else apart should it be described?
>>
>>> Why not use a regexp pattern to check IPv4 and IPv6 address? without a
>>> ipvX
>>> prefix ?
>>
>> Not sure I understand.
>>
>>> And why not considering if the ipSource (as is) isn't a IP address (4/6),
>>> and not is in the interface's list on host, then it's a hostname, else
>>> return an error.
>>> Therefore it's not necessary to have special prefix to fill the field.
>>
>> Two issues:
>> - if the interface name is checked first, it will override the
>> identical hostname, which could cause existing tests to fail (not all
>> that likely, but possible)
>> - if the name is not an interface, the check is unnecessary
>>
>> That's why I chose a prefix that cannot be present in a host name.
>
>
> Ok, in this case, perhaps, a (better?) solution is to provide a combo box to
> allow the user to choice the source address field.

I was trying to avoid increasing the complexity of the GUI.

It's a fairly unusual use-case, so I took the view that the user would
not mind putting up with a slightly unusual syntax.

> With the combo box, the user could use the common / usual name for their
> device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)
>
> Here a screenshot of HTTP Request with some improvements for reduce the
> width screen size (font changes for the Optional panel and HTTP options) +
> the Src IP combo box.
> http://www.milamberspace.net/img/http-request-src-addr.png

The IPv4/6 addr entries are ambiguous.
Do they apply only to devices?
I would hope so, otherwise existing test plans will break.
In which case, the entries need to be renamed.

The field currently supports Hostname or IP address; it is important
that compatibilty is maintained.

So the first entry should be for the Hostname/IP addr.
The entries need to be something like:

Hostname/IP
Device
Device IPv4
Device IPv6

> I can commit the UI changes for reduce the minimal width of the HTTP
> Request's pane,

Although the GUI is roughly the same width, it is more complicated.

> and if your are agree the changes to add the combo box?

I'm not convinced the change makes it easier for the user.
There would be two fields to configure instead of one.

The fields should be enclosed in a box so that it is clear they are related.
For example, as is done for Web Server & Timeouts.

Maybe the "Embedded URLs must match" field should also have a border.

> (please note, the rename of Source IP address field)

That's OK.

>
>
>
>
>>
>>>
>>>
>>>
>>>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix
>>>> to "/".
>>>>
>>>>>> +    private static final String IPV4 = "ipv4/";
>>>>>>
> [snip]

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Milamber <mi...@apache.org>.
Le 08/08/2013 20:43, sebb a ecrit :
> [snip]
> -    private static final String DEVICE_PREFIX = "/dev/";
> +    private static final String DEVICE_PREFIX = "/";
>>>>
>>>>
>>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>>
>>> Yes, that was deliberate. I changed the docs accordingly.
>>>
>>> You need to use /eth0.
>>
>> /eth0 don't works, but /ipv4/eth0 works.
> That should work - it works for me on Win/XP.
>
> Add some debug and see why it's not working.
>
>> Seems very complicated to find the good syntax (without read the docs or
>> with "IP source address" label only)
> Where else apart should it be described?
>
>> Why not use a regexp pattern to check IPv4 and IPv6 address? without a ipvX
>> prefix ?
> Not sure I understand.
>
>> And why not considering if the ipSource (as is) isn't a IP address (4/6),
>> and not is in the interface's list on host, then it's a hostname, else
>> return an error.
>> Therefore it's not necessary to have special prefix to fill the field.
> Two issues:
> - if the interface name is checked first, it will override the
> identical hostname, which could cause existing tests to fail (not all
> that likely, but possible)
> - if the name is not an interface, the check is unnecessary
>
> That's why I chose a prefix that cannot be present in a host name.

Ok, in this case, perhaps, a (better?) solution is to provide a combo 
box to allow the user to choice the source address field.

With the combo box, the user could use the common / usual name for their 
device (only eth0, wlan0, etc.), IP or hostname (short or fdqn)

Here a screenshot of HTTP Request with some improvements for reduce the 
width screen size (font changes for the Optional panel and HTTP options) 
+ the Src IP combo box.
http://www.milamberspace.net/img/http-request-src-addr.png

I can commit the UI changes for reduce the minimal width of the HTTP 
Request's pane,
and if your are agree the changes to add the combo box? (please note, 
the rename of Source IP address field)




>
>>
>>
>>
>>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix
>>> to "/".
>>>
>>>>> +    private static final String IPV4 = "ipv4/";
>>>>>
[snip]

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 8 August 2013 14:15, Milamber <mi...@apache.org> wrote:
>
> Le 08/08/2013 12:17, sebb a ecrit :
>
>> On 8 August 2013 12:30, Milamber <mi...@apache.org> wrote:
>>>
>>> Le 08/08/2013 10:39, sebb@apache.org a ecrit :
>>>
>>>> Author: sebb
>>>> Date: Thu Aug  8 10:39:14 2013
>>>> New Revision: 1511681
>>>>
>>>> URL: http://svn.apache.org/r1511681
>>>> Log:
>>>> Support device in addition to source IP address
>>>> Support choice of IPv4 or IPv6; report error if selected interface is
>>>> not
>>>> found
>>>> Bugzilla Id: 54874
>>>>
>>>> Modified:
>>>>
>>>>
>>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>>>       jmeter/trunk/xdocs/usermanual/component_reference.xml
>>>>
>>>> Modified:
>>>>
>>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java?rev=1511681&r1=1511680&r2=1511681&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>>> (original)
>>>> +++
>>>>
>>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>>> Thu Aug  8 10:39:14 2013
>>>> @@ -21,13 +21,14 @@ package org.apache.jmeter.protocol.http.
>>>>    import java.io.BufferedInputStream;
>>>>    import java.io.IOException;
>>>>    import java.io.InputStream;
>>>> +import java.net.Inet4Address;
>>>> +import java.net.Inet6Address;
>>>>    import java.net.InetAddress;
>>>>    import java.net.InterfaceAddress;
>>>>    import java.net.NetworkInterface;
>>>>    import java.net.SocketException;
>>>>    import java.net.URL;
>>>>    import java.net.UnknownHostException;
>>>> -import java.util.List;
>>>>      import org.apache.jmeter.config.Arguments;
>>>>    import org.apache.jmeter.protocol.http.control.AuthManager;
>>>> @@ -144,7 +145,9 @@ public abstract class HTTPAbstractImpl i
>>>>         * The prefix used to distiguish a device name from a host name.
>>>>         * Host names cannot start with "/".
>>>>         */
>>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>>> +    private static final String DEVICE_PREFIX = "/";
>>>
>>>
>>>
>>> This changes introduce an regression, /dev/eth0 don't works now.
>>>
>> Yes, that was deliberate. I changed the docs accordingly.
>>
>> You need to use /eth0.
>
>
> /eth0 don't works, but /ipv4/eth0 works.

That should work - it works for me on Win/XP.

Add some debug and see why it's not working.

> Seems very complicated to find the good syntax (without read the docs or
> with "IP source address" label only)

Where else apart should it be described?

> Why not use a regexp pattern to check IPv4 and IPv6 address? without a ipvX
> prefix ?

Not sure I understand.

> And why not considering if the ipSource (as is) isn't a IP address (4/6),
> and not is in the interface's list on host, then it's a hostname, else
> return an error.
> Therefore it's not necessary to have special prefix to fill the field.

Two issues:
- if the interface name is checked first, it will override the
identical hostname, which could cause existing tests to fail (not all
that likely, but possible)
- if the name is not an interface, the check is unnecessary

That's why I chose a prefix that cannot be present in a host name.

>
>
>
>
>>
>> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix
>> to "/".
>>
>>>
>>>> +    private static final String IPV4 = "ipv4/";
>>>> +    private static final String IPV6 = "ipv6/";
>>>>          /**
>>>>         * Gets the IP source address (IP spoofing) if one has been
>>>> provided.
>>>> @@ -157,19 +160,32 @@ public abstract class HTTPAbstractImpl i
>>>>            final String ipSource = getIpSource();
>>>>            if (ipSource.length() > 0) {
>>>>                if (ipSource.startsWith(DEVICE_PREFIX)) {
>>>> -                final String device =
>>>> ipSource.substring(DEVICE_PREFIX.length());
>>>> -                NetworkInterface net =
>>>> NetworkInterface.getByName(device);
>>>> +                String interfaceName =
>>>> ipSource.substring(DEVICE_PREFIX.length());
>>>
>>>
>>>
>>> If the the ipSource is "/dev/eth0", the interfaceName become "dev/eth0"
>>> and
>>> generate this error:
>>>
>>> java.net.UnknownHostException: Cannot find interface dev/wlan0
>>>      at
>>>
>>> org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.getIpSourceAddress(HTTPAbstractImpl.java:184)
>>>      at
>>>
>>> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setupRequest(HTTPHC4Impl.java:671)
>>>      at
>>>
>>> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:269)
>>>      at
>>>
>>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
>>>      at
>>>
>>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1080)
>>>      at
>>>
>>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1069)
>>>      at
>>>
>>> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
>>>      at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
>>>      at java.lang.Thread.run(Thread.java:679)
>>>
>>>
>>>
>>>
>>>> +                final Class<? extends InetAddress> ipClass;
>>>> +                if (interfaceName.startsWith(IPV4)) {
>>>> +                    interfaceName =
>>>> interfaceName.substring(IPV4.length());
>>>> +                    ipClass = Inet4Address.class;
>>>> +                } else if (interfaceName.startsWith(IPV6)) {
>>>> +                    interfaceName =
>>>> interfaceName.substring(IPV6.length());
>>>> +                    ipClass = Inet6Address.class;
>>>> +                } else {
>>>> +                    ipClass = InetAddress.class;
>>>> +                }
>>>> +                NetworkInterface net =
>>>> NetworkInterface.getByName(interfaceName);
>>>>                    if (net != null) {
>>>> -                    List<InterfaceAddress> netAds =
>>>> net.getInterfaceAddresses();
>>>> -                    if (netAds.size() > 0) {
>>>> -                        return netAds.get(0).getAddress();
>>>> +                    for (InterfaceAddress ia :
>>>> net.getInterfaceAddresses()) {
>>>> +                        final InetAddress inetAddr = ia.getAddress();
>>>> +                        if (ipClass.isInstance(inetAddr)) {
>>>> +                            return inetAddr;
>>>> +                        }
>>>>                        }
>>>> +                    throw new UnknownHostException("Interface " +
>>>> interfaceName + " does not have address of type " +
>>>> ipClass.getSimpleName());
>>>>                    }
>>>> -                return null;
>>>> +                throw new UnknownHostException("Cannot find interface "
>>>> +
>>>> interfaceName);
>>>>                }
>>>>                return InetAddress.getByName(ipSource);
>>>>            }
>>>> -        return null;
>>>> +        return null; // did not want to spoof the IP address
>>>>        }
>>>>          /**
>>>>
>>>> Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1511681&r1=1511680&r2=1511681&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> --- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
>>>> +++ jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Aug  8
>>>> 10:39:14 2013
>>>> @@ -323,9 +323,11 @@ and send HTTP/HTTPS requests for all ima
>>>>            [Only for HTTP Request HTTPClient]
>>>>            Override the default local IP address for this sample.
>>>>            The JMeter host must have multiple IP addresses (i.e. IP
>>>> aliases
>>>> or network interfaces).
>>>> -        The value can be a host name, IP address, or a network
>>>> interface
>>>> device such as "eth0" or "le0".
>>>> -        In order to distinguish these from host names, the interface
>>>> name
>>>> must be entered with the prefix "/dev/",
>>>> -        for example "/dev/eth0" or "/dev/le0".
>>>> +        The value can be a host name, IP address, or a network
>>>> interface
>>>> device such as "eth0" or "lo0".
>>>> +        In order to distinguish these from host names, the interface
>>>> name
>>>> must be entered with the prefix "/",
>>>> +        for example "/eth0" or "/lo0". This will pick the first
>>>> available
>>>> address for that interface which
>>>> +        this may be either IPV4 or IPV6. To select a specific IP
>>>> protocol
>>>> version, prefix the interface name
>>>> +        with "/ipv4/" or "/ipv6/", for example "/ipv4/eth0" or
>>>> "/ipv6/eth0"
>>>>            If the property <b>httpclient.localaddress</b> is defined,
>>>> that
>>>> is used for all HttpClient requests.
>>>>            </property>
>>>>    </properties>
>>>>
>>>>
>>>>
>

Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by Milamber <mi...@apache.org>.
Le 08/08/2013 12:17, sebb a ecrit :
> On 8 August 2013 12:30, Milamber <mi...@apache.org> wrote:
>> Le 08/08/2013 10:39, sebb@apache.org a ecrit :
>>
>>> Author: sebb
>>> Date: Thu Aug  8 10:39:14 2013
>>> New Revision: 1511681
>>>
>>> URL: http://svn.apache.org/r1511681
>>> Log:
>>> Support device in addition to source IP address
>>> Support choice of IPv4 or IPv6; report error if selected interface is not
>>> found
>>> Bugzilla Id: 54874
>>>
>>> Modified:
>>>
>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>>       jmeter/trunk/xdocs/usermanual/component_reference.xml
>>>
>>> Modified:
>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>> URL:
>>> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java?rev=1511681&r1=1511680&r2=1511681&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>> (original)
>>> +++
>>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>> Thu Aug  8 10:39:14 2013
>>> @@ -21,13 +21,14 @@ package org.apache.jmeter.protocol.http.
>>>    import java.io.BufferedInputStream;
>>>    import java.io.IOException;
>>>    import java.io.InputStream;
>>> +import java.net.Inet4Address;
>>> +import java.net.Inet6Address;
>>>    import java.net.InetAddress;
>>>    import java.net.InterfaceAddress;
>>>    import java.net.NetworkInterface;
>>>    import java.net.SocketException;
>>>    import java.net.URL;
>>>    import java.net.UnknownHostException;
>>> -import java.util.List;
>>>      import org.apache.jmeter.config.Arguments;
>>>    import org.apache.jmeter.protocol.http.control.AuthManager;
>>> @@ -144,7 +145,9 @@ public abstract class HTTPAbstractImpl i
>>>         * The prefix used to distiguish a device name from a host name.
>>>         * Host names cannot start with "/".
>>>         */
>>> -    private static final String DEVICE_PREFIX = "/dev/";
>>> +    private static final String DEVICE_PREFIX = "/";
>>
>>
>> This changes introduce an regression, /dev/eth0 don't works now.
>>
> Yes, that was deliberate. I changed the docs accordingly.
>
> You need to use /eth0.

/eth0 don't works, but /ipv4/eth0 works.

Seems very complicated to find the good syntax (without read the docs or 
with "IP source address" label only)

Why not use a regexp pattern to check IPv4 and IPv6 address? without a 
ipvX prefix ?

And why not considering if the ipSource (as is) isn't a IP address 
(4/6), and not is in the interface's list on host, then it's a hostname, 
else return an error.
Therefore it's not necessary to have special prefix to fill the field.




>
> I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix to "/".
>
>>
>>> +    private static final String IPV4 = "ipv4/";
>>> +    private static final String IPV6 = "ipv6/";
>>>          /**
>>>         * Gets the IP source address (IP spoofing) if one has been
>>> provided.
>>> @@ -157,19 +160,32 @@ public abstract class HTTPAbstractImpl i
>>>            final String ipSource = getIpSource();
>>>            if (ipSource.length() > 0) {
>>>                if (ipSource.startsWith(DEVICE_PREFIX)) {
>>> -                final String device =
>>> ipSource.substring(DEVICE_PREFIX.length());
>>> -                NetworkInterface net =
>>> NetworkInterface.getByName(device);
>>> +                String interfaceName =
>>> ipSource.substring(DEVICE_PREFIX.length());
>>
>>
>> If the the ipSource is "/dev/eth0", the interfaceName become "dev/eth0" and
>> generate this error:
>>
>> java.net.UnknownHostException: Cannot find interface dev/wlan0
>>      at
>> org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.getIpSourceAddress(HTTPAbstractImpl.java:184)
>>      at
>> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setupRequest(HTTPHC4Impl.java:671)
>>      at
>> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:269)
>>      at
>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
>>      at
>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1080)
>>      at
>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1069)
>>      at
>> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
>>      at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
>>      at java.lang.Thread.run(Thread.java:679)
>>
>>
>>
>>
>>> +                final Class<? extends InetAddress> ipClass;
>>> +                if (interfaceName.startsWith(IPV4)) {
>>> +                    interfaceName =
>>> interfaceName.substring(IPV4.length());
>>> +                    ipClass = Inet4Address.class;
>>> +                } else if (interfaceName.startsWith(IPV6)) {
>>> +                    interfaceName =
>>> interfaceName.substring(IPV6.length());
>>> +                    ipClass = Inet6Address.class;
>>> +                } else {
>>> +                    ipClass = InetAddress.class;
>>> +                }
>>> +                NetworkInterface net =
>>> NetworkInterface.getByName(interfaceName);
>>>                    if (net != null) {
>>> -                    List<InterfaceAddress> netAds =
>>> net.getInterfaceAddresses();
>>> -                    if (netAds.size() > 0) {
>>> -                        return netAds.get(0).getAddress();
>>> +                    for (InterfaceAddress ia :
>>> net.getInterfaceAddresses()) {
>>> +                        final InetAddress inetAddr = ia.getAddress();
>>> +                        if (ipClass.isInstance(inetAddr)) {
>>> +                            return inetAddr;
>>> +                        }
>>>                        }
>>> +                    throw new UnknownHostException("Interface " +
>>> interfaceName + " does not have address of type " +
>>> ipClass.getSimpleName());
>>>                    }
>>> -                return null;
>>> +                throw new UnknownHostException("Cannot find interface " +
>>> interfaceName);
>>>                }
>>>                return InetAddress.getByName(ipSource);
>>>            }
>>> -        return null;
>>> +        return null; // did not want to spoof the IP address
>>>        }
>>>          /**
>>>
>>> Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
>>> URL:
>>> http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1511681&r1=1511680&r2=1511681&view=diff
>>>
>>> ==============================================================================
>>> --- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
>>> +++ jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Aug  8
>>> 10:39:14 2013
>>> @@ -323,9 +323,11 @@ and send HTTP/HTTPS requests for all ima
>>>            [Only for HTTP Request HTTPClient]
>>>            Override the default local IP address for this sample.
>>>            The JMeter host must have multiple IP addresses (i.e. IP aliases
>>> or network interfaces).
>>> -        The value can be a host name, IP address, or a network interface
>>> device such as "eth0" or "le0".
>>> -        In order to distinguish these from host names, the interface name
>>> must be entered with the prefix "/dev/",
>>> -        for example "/dev/eth0" or "/dev/le0".
>>> +        The value can be a host name, IP address, or a network interface
>>> device such as "eth0" or "lo0".
>>> +        In order to distinguish these from host names, the interface name
>>> must be entered with the prefix "/",
>>> +        for example "/eth0" or "/lo0". This will pick the first available
>>> address for that interface which
>>> +        this may be either IPV4 or IPV6. To select a specific IP protocol
>>> version, prefix the interface name
>>> +        with "/ipv4/" or "/ipv6/", for example "/ipv4/eth0" or
>>> "/ipv6/eth0"
>>>            If the property <b>httpclient.localaddress</b> is defined, that
>>> is used for all HttpClient requests.
>>>            </property>
>>>    </properties>
>>>
>>>
>>>


Re: svn commit: r1511681 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java xdocs/usermanual/component_reference.xml

Posted by sebb <se...@gmail.com>.
On 8 August 2013 12:30, Milamber <mi...@apache.org> wrote:
>
> Le 08/08/2013 10:39, sebb@apache.org a ecrit :
>
>> Author: sebb
>> Date: Thu Aug  8 10:39:14 2013
>> New Revision: 1511681
>>
>> URL: http://svn.apache.org/r1511681
>> Log:
>> Support device in addition to source IP address
>> Support choice of IPv4 or IPv6; report error if selected interface is not
>> found
>> Bugzilla Id: 54874
>>
>> Modified:
>>
>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>>      jmeter/trunk/xdocs/usermanual/component_reference.xml
>>
>> Modified:
>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>> URL:
>> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java?rev=1511681&r1=1511680&r2=1511681&view=diff
>>
>> ==============================================================================
>> ---
>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>> (original)
>> +++
>> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
>> Thu Aug  8 10:39:14 2013
>> @@ -21,13 +21,14 @@ package org.apache.jmeter.protocol.http.
>>   import java.io.BufferedInputStream;
>>   import java.io.IOException;
>>   import java.io.InputStream;
>> +import java.net.Inet4Address;
>> +import java.net.Inet6Address;
>>   import java.net.InetAddress;
>>   import java.net.InterfaceAddress;
>>   import java.net.NetworkInterface;
>>   import java.net.SocketException;
>>   import java.net.URL;
>>   import java.net.UnknownHostException;
>> -import java.util.List;
>>     import org.apache.jmeter.config.Arguments;
>>   import org.apache.jmeter.protocol.http.control.AuthManager;
>> @@ -144,7 +145,9 @@ public abstract class HTTPAbstractImpl i
>>        * The prefix used to distiguish a device name from a host name.
>>        * Host names cannot start with "/".
>>        */
>> -    private static final String DEVICE_PREFIX = "/dev/";
>> +    private static final String DEVICE_PREFIX = "/";
>
>
>
> This changes introduce an regression, /dev/eth0 don't works now.
>

Yes, that was deliberate. I changed the docs accordingly.

You need to use /eth0.

I thought it was awkard to use /dev/ipv6/eth0, so I collapsed the prefix to "/".

>
>
>> +    private static final String IPV4 = "ipv4/";
>> +    private static final String IPV6 = "ipv6/";
>>         /**
>>        * Gets the IP source address (IP spoofing) if one has been
>> provided.
>> @@ -157,19 +160,32 @@ public abstract class HTTPAbstractImpl i
>>           final String ipSource = getIpSource();
>>           if (ipSource.length() > 0) {
>>               if (ipSource.startsWith(DEVICE_PREFIX)) {
>> -                final String device =
>> ipSource.substring(DEVICE_PREFIX.length());
>> -                NetworkInterface net =
>> NetworkInterface.getByName(device);
>> +                String interfaceName =
>> ipSource.substring(DEVICE_PREFIX.length());
>
>
>
> If the the ipSource is "/dev/eth0", the interfaceName become "dev/eth0" and
> generate this error:
>
> java.net.UnknownHostException: Cannot find interface dev/wlan0
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.getIpSourceAddress(HTTPAbstractImpl.java:184)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setupRequest(HTTPHC4Impl.java:671)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:269)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1080)
>     at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1069)
>     at
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
>     at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
>     at java.lang.Thread.run(Thread.java:679)
>
>
>
>
>> +                final Class<? extends InetAddress> ipClass;
>> +                if (interfaceName.startsWith(IPV4)) {
>> +                    interfaceName =
>> interfaceName.substring(IPV4.length());
>> +                    ipClass = Inet4Address.class;
>> +                } else if (interfaceName.startsWith(IPV6)) {
>> +                    interfaceName =
>> interfaceName.substring(IPV6.length());
>> +                    ipClass = Inet6Address.class;
>> +                } else {
>> +                    ipClass = InetAddress.class;
>> +                }
>> +                NetworkInterface net =
>> NetworkInterface.getByName(interfaceName);
>>                   if (net != null) {
>> -                    List<InterfaceAddress> netAds =
>> net.getInterfaceAddresses();
>> -                    if (netAds.size() > 0) {
>> -                        return netAds.get(0).getAddress();
>> +                    for (InterfaceAddress ia :
>> net.getInterfaceAddresses()) {
>> +                        final InetAddress inetAddr = ia.getAddress();
>> +                        if (ipClass.isInstance(inetAddr)) {
>> +                            return inetAddr;
>> +                        }
>>                       }
>> +                    throw new UnknownHostException("Interface " +
>> interfaceName + " does not have address of type " +
>> ipClass.getSimpleName());
>>                   }
>> -                return null;
>> +                throw new UnknownHostException("Cannot find interface " +
>> interfaceName);
>>               }
>>               return InetAddress.getByName(ipSource);
>>           }
>> -        return null;
>> +        return null; // did not want to spoof the IP address
>>       }
>>         /**
>>
>> Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
>> URL:
>> http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1511681&r1=1511680&r2=1511681&view=diff
>>
>> ==============================================================================
>> --- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
>> +++ jmeter/trunk/xdocs/usermanual/component_reference.xml Thu Aug  8
>> 10:39:14 2013
>> @@ -323,9 +323,11 @@ and send HTTP/HTTPS requests for all ima
>>           [Only for HTTP Request HTTPClient]
>>           Override the default local IP address for this sample.
>>           The JMeter host must have multiple IP addresses (i.e. IP aliases
>> or network interfaces).
>> -        The value can be a host name, IP address, or a network interface
>> device such as "eth0" or "le0".
>> -        In order to distinguish these from host names, the interface name
>> must be entered with the prefix "/dev/",
>> -        for example "/dev/eth0" or "/dev/le0".
>> +        The value can be a host name, IP address, or a network interface
>> device such as "eth0" or "lo0".
>> +        In order to distinguish these from host names, the interface name
>> must be entered with the prefix "/",
>> +        for example "/eth0" or "/lo0". This will pick the first available
>> address for that interface which
>> +        this may be either IPV4 or IPV6. To select a specific IP protocol
>> version, prefix the interface name
>> +        with "/ipv4/" or "/ipv6/", for example "/ipv4/eth0" or
>> "/ipv6/eth0"
>>           If the property <b>httpclient.localaddress</b> is defined, that
>> is used for all HttpClient requests.
>>           </property>
>>   </properties>
>>
>>
>>
>