All Projects → FRRouting → topotests

FRRouting / topotests

Licence: other
Moved to frrouting/frr

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to topotests

Memoscope.net
Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd )
Stars: ✭ 626 (+2880.95%)
Mutual labels:  memory-leak
Hjnsobjectreleasedemo
Stars: ✭ 63 (+200%)
Mutual labels:  memory-leak
Easy Monitor
企业级 Node.js 应用性能监控与线上故障定位解决方案
Stars: ✭ 2,451 (+11571.43%)
Mutual labels:  memory-leak
Js Leakage Patterns
🎯这是关于JavaScript内存泄露和CSS优化相关序列文章,相信你读完会有所收获的✈️
Stars: ✭ 756 (+3500%)
Mutual labels:  memory-leak
Windbg Cheat Sheet
A practical guide to analyze memory dumps of .Net applications by using Windbg
Stars: ✭ 43 (+104.76%)
Mutual labels:  memory-leak
Leakage
🐛 Memory leak testing for node.
Stars: ✭ 1,531 (+7190.48%)
Mutual labels:  memory-leak
Php Memory Profiler
Memory leak profiler for PHP
Stars: ✭ 544 (+2490.48%)
Mutual labels:  memory-leak
mem usage ui
Measuring and graphing memory usage of local processes
Stars: ✭ 124 (+490.48%)
Mutual labels:  memory-leak
Heapusage
Find memory leaks in Linux and macOS applications
Stars: ✭ 53 (+152.38%)
Mutual labels:  memory-leak
Avoid Memory Leak Android
🔥 Examples of memory leaks and common patterns that cause them in Android development and how to fix/avoid them
Stars: ✭ 140 (+566.67%)
Mutual labels:  memory-leak
Free checker
Simple memory leak finder (for C program) using LD_PRELOAD.
Stars: ✭ 5 (-76.19%)
Mutual labels:  memory-leak
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (+38.1%)
Mutual labels:  memory-leak
Mmat
An automatically testing and analysis hprof library for android app (自动分析Android内存泄漏)
Stars: ✭ 137 (+552.38%)
Mutual labels:  memory-leak
Leakcanary
A memory leak detection library for Android.
Stars: ✭ 27,029 (+128609.52%)
Mutual labels:  memory-leak
Awesome Android Performance
Android performance optimization tutorials, videos and tools list(Android性能优化视频,文档以及工具)
Stars: ✭ 2,725 (+12876.19%)
Mutual labels:  memory-leak
Memleax
debugs memory leak of running process. Not maintained anymore, try `libleak` please.
Stars: ✭ 564 (+2585.71%)
Mutual labels:  memory-leak
Unityheapcrawler
Reflection based heap shapshot tool for Unity game engine
Stars: ✭ 91 (+333.33%)
Mutual labels:  memory-leak
poireau
Poireau: a sampling allocation debugger
Stars: ✭ 76 (+261.9%)
Mutual labels:  memory-leak
DisposableFixer
This is a Visual Studio Extension and NuGet package that should identify and fix problems as memleaks while using IDisposables.
Stars: ✭ 37 (+76.19%)
Mutual labels:  memory-leak
Libleak
detect memory leak by LD_PRELOAD, without changing the target program
Stars: ✭ 139 (+561.9%)
Mutual labels:  memory-leak

Archived

This repository has been merged with FRR's main codebase at tests/topotests.

Development continues there.

FRRouting Topology Tests with Mininet

Guidelines

Instructions for use, write or debug topologies can be found in the guidelines. To learn/remember common code snippets see here.

Before creating a new topology, make sure that there isn't one already that does what you need. If nothing is similar, then you may create a new topology, preferably, using the newest template.

Installation of Mininet for running tests

Only tested with Ubuntu 16.04 and Ubuntu 18.04 (which uses Mininet 2.2.x)

Instructions are the same for all setups (ie ExaBGP is only used for BGP tests)

Installing Mininet Infrastructure:

  1. apt-get install mininet
  2. apt-get install python-pip
  3. apt-get install iproute
  4. pip install ipaddr
  5. pip install pytest
  6. pip install exabgp==3.4.17 (Newer 4.0 version of exabgp is not yet supported)
  7. useradd -d /var/run/exabgp/ -s /bin/false exabgp

Enable Coredumps

Optional, will give better output

  1. apt-get install gdb

  2. disable apport (which move core files)

    Set enabled=0 in /etc/default/apport

  3. Update security limits

    Add/change /etc/security/limits.conf to

     #<domain>      <type>  <item>         <value>
     *               soft    core          unlimited
     root            soft    core          unlimited
     *               hard    core          unlimited
     root            hard    core          unlimited
    
  4. reboot (for options to take effect)

FRRouting (FRR) Installation

FRR needs to be installed separatly. It is assume to be configured like the standard Ubuntu Packages:

  • Binaries in /usr/lib/frr
  • State Directory /var/run/frr
  • Running under user frr, group frr
  • vtygroup: frrvty
  • config directory: /etc/frr
  • For FRR Packages, install the dbg package as well for coredump decoding

No FRR config needs to be done and no FRR daemons should be run ahead of the test. They are all started as part of the test

Manual FRRouting (FRR) build

If you prefer to manually build FRR, then use the following suggested config:

./configure \
	--prefix=/usr \
	--localstatedir=/var/run/frr \
	--sbindir=/usr/lib/frr \
	--sysconfdir=/etc/frr \
	--enable-vtysh \
	--enable-pimd \
	--enable-multipath=64 \
	--enable-user=frr \
	--enable-group=frr \
	--enable-vty-group=frrvty \
	--with-pkg-extra-version=-my-manual-build

And create frr User and frrvty group as follows:

addgroup --system --gid 92 frr
addgroup --system --gid 85 frrvty
adduser --system --ingroup frr --home /var/run/frr/ \
   --gecos "FRRouting suite" --shell /bin/false frr
usermod -G frrvty frr

Executing Tests

Execute all tests with output to console

py.test -s -v --tb=no

All test_* scripts in subdirectories are detected and executed (unless disabled in pytest.ini file)

--tb=no disables the python traceback which might be irrelevant unless the test script itself is debugged

Execute single test

cd test_to_be_run
./test_to_be_run.py

For further options, refer to pytest documentation

Test will set exit code which can be used with git bisect

For the simulated topology, see the description in the python file

If you need to clear the mininet setup between tests (if it isn't cleanly shutdown), then use the mn -c command to clean up the environment

(Optional) StdErr log from daemos after exit

To enable the reporting of any messages seen on StdErr after the daemons exit, the following env variable can be set.

export TOPOTESTS_CHECK_STDERR=Yes

(The value doesn't matter at this time. The check is if the env variable exists or not) There is no pass/fail on this reporting. The Output will be reported to the console

export TOPOTESTS_CHECK_MEMLEAK="/home/mydir/memleak_"

This will enable the check and output to console and the writing of the information to files with the given prefix (followed by testname), ie /home/mydir/memcheck_test_bgp_multiview_topo1.txt in case of a memory leak.

(Optional) Collect Memory Leak Information

FreeRangeRouting processes have the capabilities to report remaining memory allocations upon exit. To enable the reporting of the memory, define an enviroment variable TOPOTESTS_CHECK_MEMLEAK with the file prefix, ie

export TOPOTESTS_CHECK_MEMLEAK="/home/mydir/memleak_"

This will enable the check and output to console and the writing of the information to files with the given prefix (followed by testname), ie /home/mydir/memcheck_test_bgp_multiview_topo1.txt in case of a memory leak.

(Optional) Run topotests with GCC AddressSanitizer enabled

Topotests can be run with the GCC AddressSanitizer. It requires GCC 4.8 or newer. (Ubuntu 16.04 as suggested here is fine with GCC 5 as default) For more information on AddressSanitizer, see https://github.com/google/sanitizers/wiki/AddressSanitizer

The checks are done automatically in the library call of checkRouterRunning (ie at beginning of tests when there is a check for all daemons running). No changes or extra configuration for topotests is required beside compiling the suite with AddressSanitizer enabled.

If a daemon crashed, then the errorlog is checked for AddressSanitizer output. If found, then this is added with context (calling test) to /tmp/AddressSanitizer.txt in markdown compatible format.

Compiling for GCC AddressSanitizer requires to use gcc as a linker as well (instead of ld). Here is a suggest way to compile frr with AddressSanitizer for stable/3.0 branch:

git clone https://github.com/FRRouting/frr.git
cd frr
git checkout stable/3.0
./bootstrap.sh
export CC=gcc
export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
export LD=gcc
export LDFLAGS="-g -fsanitize=address -ldl"
./configure --enable-shared=no \
	--prefix=/usr/lib/frr --sysconfdir=/etc/frr \
	--localstatedir=/var/run/frr \
	--sbindir=/usr/lib/frr --bindir=/usr/lib/frr \
	--enable-exampledir=/usr/lib/frr/examples \
	--with-moduledir=/usr/lib/frr/modules \
	--enable-multipath=0 --enable-rtadv \
	--enable-tcp-zebra --enable-fpm --enable-pimd
make
sudo make install
# Create symlink for vtysh, so topotest finds it in /usr/lib/frr
sudo ln -s /usr/lib/frr/vtysh /usr/bin/

and create frr user and frrvty group as shown above

License

All the configs and scripts are licensed under a ISC-style license. See Python scripts for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].