You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficcontrol.apache.org by Amir Yeshurun <am...@qwilt.com> on 2017/01/26 14:37:14 UTC

Debugging TO in a local (dev) environment

Hi,

I'm running a local instance of TO, and debugging the CDN health API route
/api/1.2/cdns/health

In order to report the CDN health, TO need to read cache status from
Traffic Monitor, which in turn, has to collect status from the caches.

I am looking for a way to create a dev setup on which I can debug such use
cases, without having to run numerous monitors and caches.

Does the unit/integration test framework provides infrastructure to mock
Traffic Monitor responses?

Are there other kind of mocks that can mimic Traffic Monitor responses?

I'd appreciate any tips and practices.

Thanks
/amiry

Re: Debugging TO in a local (dev) environment

Posted by David Neuman <da...@gmail.com>.
You should be able to just run it like this:
/usr/local/bin/node
/git/apache/incubator-trafficcontrol/traffic_monitor/etc/ats_sim.js
https://<traffic_ops_url>/CRConfig-Snapshots/<cdn_name>/CRConfig.json
<port>
​

On Sun, Jan 29, 2017 at 8:57 AM, Amir Yeshurun <am...@qwilt.com> wrote:

> Hi Dave,
>
> Can you elaborate on how to run the ats_sim.js script?
> I tried to run it as a stand alone script, using the node command line, but
> the requests against TO are unauthorized, as it does not handle login.
>
> Thanks
> /amiry
>
> On Fri, Jan 27, 2017 at 6:17 PM Dave Neuman <ne...@apache.org> wrote:
>
> > +1, we have some internal tools floating around to do some of that, but
> > nothing available publicly (or ready for public consumption).  I would
> > definitely be in favor of adding some of those things to the project.
> >
> > On Fri, Jan 27, 2017 at 6:25 AM, Amir Yeshurun <am...@qwilt.com> wrote:
> >
> > > Thanks a lot, Dave,
> > >
> > > I'd like to consider investing in such testing tools.
> > >
> > > In addition to cache simulation, we can create clients simulation, to
> > debug
> > > request routing path. A Traffic Monitor mock, to debug motioning path
> > > without caches,
> > > and maybe more.
> > >
> > > I would be glad to hear any insights about this.
> > >
> > > Thanks
> > > /amiry
> > >
> > > On Thu, Jan 26, 2017 at 7:10 PM Dave Neuman <ne...@apache.org> wrote:
> > >
> > > > Hey Amiry,
> > > > Unfortunately we do not have a mock version of Traffic Monitor to use
> > for
> > > > testing.  We do, however, have an ATS simulator here:
> > > >
> > > > https://github.com/apache/incubator-trafficcontrol/blob/
> > > master/traffic_monitor/etc/ats_sim.js
> > > > which you can use with a Traffic Monitor to simulate traffic monitor
> > > > polling caches and sending responses.
> > > > Hopefully that helps.
> > > >
> > > > Thanks,
> > > > Dave
> > > >
> > > > On Thu, Jan 26, 2017 at 7:37 AM, Amir Yeshurun <am...@qwilt.com>
> > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I'm running a local instance of TO, and debugging the CDN health
> API
> > > > route
> > > > > /api/1.2/cdns/health
> > > > >
> > > > > In order to report the CDN health, TO need to read cache status
> from
> > > > > Traffic Monitor, which in turn, has to collect status from the
> > caches.
> > > > >
> > > > > I am looking for a way to create a dev setup on which I can debug
> > such
> > > > use
> > > > > cases, without having to run numerous monitors and caches.
> > > > >
> > > > > Does the unit/integration test framework provides infrastructure to
> > > mock
> > > > > Traffic Monitor responses?
> > > > >
> > > > > Are there other kind of mocks that can mimic Traffic Monitor
> > responses?
> > > > >
> > > > > I'd appreciate any tips and practices.
> > > > >
> > > > > Thanks
> > > > > /amiry
> > > > >
> > > >
> > >
> >
>

Re: Debugging TO in a local (dev) environment

Posted by Amir Yeshurun <am...@qwilt.com>.
Hi Dave,

Can you elaborate on how to run the ats_sim.js script?
I tried to run it as a stand alone script, using the node command line, but
the requests against TO are unauthorized, as it does not handle login.

Thanks
/amiry

On Fri, Jan 27, 2017 at 6:17 PM Dave Neuman <ne...@apache.org> wrote:

> +1, we have some internal tools floating around to do some of that, but
> nothing available publicly (or ready for public consumption).  I would
> definitely be in favor of adding some of those things to the project.
>
> On Fri, Jan 27, 2017 at 6:25 AM, Amir Yeshurun <am...@qwilt.com> wrote:
>
> > Thanks a lot, Dave,
> >
> > I'd like to consider investing in such testing tools.
> >
> > In addition to cache simulation, we can create clients simulation, to
> debug
> > request routing path. A Traffic Monitor mock, to debug motioning path
> > without caches,
> > and maybe more.
> >
> > I would be glad to hear any insights about this.
> >
> > Thanks
> > /amiry
> >
> > On Thu, Jan 26, 2017 at 7:10 PM Dave Neuman <ne...@apache.org> wrote:
> >
> > > Hey Amiry,
> > > Unfortunately we do not have a mock version of Traffic Monitor to use
> for
> > > testing.  We do, however, have an ATS simulator here:
> > >
> > > https://github.com/apache/incubator-trafficcontrol/blob/
> > master/traffic_monitor/etc/ats_sim.js
> > > which you can use with a Traffic Monitor to simulate traffic monitor
> > > polling caches and sending responses.
> > > Hopefully that helps.
> > >
> > > Thanks,
> > > Dave
> > >
> > > On Thu, Jan 26, 2017 at 7:37 AM, Amir Yeshurun <am...@qwilt.com>
> wrote:
> > >
> > > > Hi,
> > > >
> > > > I'm running a local instance of TO, and debugging the CDN health API
> > > route
> > > > /api/1.2/cdns/health
> > > >
> > > > In order to report the CDN health, TO need to read cache status from
> > > > Traffic Monitor, which in turn, has to collect status from the
> caches.
> > > >
> > > > I am looking for a way to create a dev setup on which I can debug
> such
> > > use
> > > > cases, without having to run numerous monitors and caches.
> > > >
> > > > Does the unit/integration test framework provides infrastructure to
> > mock
> > > > Traffic Monitor responses?
> > > >
> > > > Are there other kind of mocks that can mimic Traffic Monitor
> responses?
> > > >
> > > > I'd appreciate any tips and practices.
> > > >
> > > > Thanks
> > > > /amiry
> > > >
> > >
> >
>

Re: Debugging TO in a local (dev) environment

Posted by Dave Neuman <ne...@apache.org>.
+1, we have some internal tools floating around to do some of that, but
nothing available publicly (or ready for public consumption).  I would
definitely be in favor of adding some of those things to the project.

On Fri, Jan 27, 2017 at 6:25 AM, Amir Yeshurun <am...@qwilt.com> wrote:

> Thanks a lot, Dave,
>
> I'd like to consider investing in such testing tools.
>
> In addition to cache simulation, we can create clients simulation, to debug
> request routing path. A Traffic Monitor mock, to debug motioning path
> without caches,
> and maybe more.
>
> I would be glad to hear any insights about this.
>
> Thanks
> /amiry
>
> On Thu, Jan 26, 2017 at 7:10 PM Dave Neuman <ne...@apache.org> wrote:
>
> > Hey Amiry,
> > Unfortunately we do not have a mock version of Traffic Monitor to use for
> > testing.  We do, however, have an ATS simulator here:
> >
> > https://github.com/apache/incubator-trafficcontrol/blob/
> master/traffic_monitor/etc/ats_sim.js
> > which you can use with a Traffic Monitor to simulate traffic monitor
> > polling caches and sending responses.
> > Hopefully that helps.
> >
> > Thanks,
> > Dave
> >
> > On Thu, Jan 26, 2017 at 7:37 AM, Amir Yeshurun <am...@qwilt.com> wrote:
> >
> > > Hi,
> > >
> > > I'm running a local instance of TO, and debugging the CDN health API
> > route
> > > /api/1.2/cdns/health
> > >
> > > In order to report the CDN health, TO need to read cache status from
> > > Traffic Monitor, which in turn, has to collect status from the caches.
> > >
> > > I am looking for a way to create a dev setup on which I can debug such
> > use
> > > cases, without having to run numerous monitors and caches.
> > >
> > > Does the unit/integration test framework provides infrastructure to
> mock
> > > Traffic Monitor responses?
> > >
> > > Are there other kind of mocks that can mimic Traffic Monitor responses?
> > >
> > > I'd appreciate any tips and practices.
> > >
> > > Thanks
> > > /amiry
> > >
> >
>

Re: Debugging TO in a local (dev) environment

Posted by Amir Yeshurun <am...@qwilt.com>.
Thanks a lot, Dave,

I'd like to consider investing in such testing tools.

In addition to cache simulation, we can create clients simulation, to debug
request routing path. A Traffic Monitor mock, to debug motioning path
without caches,
and maybe more.

I would be glad to hear any insights about this.

Thanks
/amiry

On Thu, Jan 26, 2017 at 7:10 PM Dave Neuman <ne...@apache.org> wrote:

> Hey Amiry,
> Unfortunately we do not have a mock version of Traffic Monitor to use for
> testing.  We do, however, have an ATS simulator here:
>
> https://github.com/apache/incubator-trafficcontrol/blob/master/traffic_monitor/etc/ats_sim.js
> which you can use with a Traffic Monitor to simulate traffic monitor
> polling caches and sending responses.
> Hopefully that helps.
>
> Thanks,
> Dave
>
> On Thu, Jan 26, 2017 at 7:37 AM, Amir Yeshurun <am...@qwilt.com> wrote:
>
> > Hi,
> >
> > I'm running a local instance of TO, and debugging the CDN health API
> route
> > /api/1.2/cdns/health
> >
> > In order to report the CDN health, TO need to read cache status from
> > Traffic Monitor, which in turn, has to collect status from the caches.
> >
> > I am looking for a way to create a dev setup on which I can debug such
> use
> > cases, without having to run numerous monitors and caches.
> >
> > Does the unit/integration test framework provides infrastructure to mock
> > Traffic Monitor responses?
> >
> > Are there other kind of mocks that can mimic Traffic Monitor responses?
> >
> > I'd appreciate any tips and practices.
> >
> > Thanks
> > /amiry
> >
>

Re: Debugging TO in a local (dev) environment

Posted by Dave Neuman <ne...@apache.org>.
Hey Amiry,
Unfortunately we do not have a mock version of Traffic Monitor to use for
testing.  We do, however, have an ATS simulator here:
https://github.com/apache/incubator-trafficcontrol/blob/master/traffic_monitor/etc/ats_sim.js
which you can use with a Traffic Monitor to simulate traffic monitor
polling caches and sending responses.
Hopefully that helps.

Thanks,
Dave

On Thu, Jan 26, 2017 at 7:37 AM, Amir Yeshurun <am...@qwilt.com> wrote:

> Hi,
>
> I'm running a local instance of TO, and debugging the CDN health API route
> /api/1.2/cdns/health
>
> In order to report the CDN health, TO need to read cache status from
> Traffic Monitor, which in turn, has to collect status from the caches.
>
> I am looking for a way to create a dev setup on which I can debug such use
> cases, without having to run numerous monitors and caches.
>
> Does the unit/integration test framework provides infrastructure to mock
> Traffic Monitor responses?
>
> Are there other kind of mocks that can mimic Traffic Monitor responses?
>
> I'd appreciate any tips and practices.
>
> Thanks
> /amiry
>