Skip to content

Commit 076e0fd

Browse files
authored
Merge pull request zardus#84 from zardus/wip/tests
Wip/tests
2 parents e1b3533 + 89e6d25 commit 076e0fd

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ language: bash
22
sudo: required
33
dist: trusty
44
env:
5-
- PATH=$TRAVIS_BUILD_DIR/bin:$PATH
5+
- PATH=$TRAVIS_BUILD_DIR/bin:$PATH SUITE="all" OPTS="-s"
6+
- PATH=$TRAVIS_BUILD_DIR/bin:$PATH SUITE="z3" OPTS="-s -v -f"
7+
- PATH=$TRAVIS_BUILD_DIR/bin:$PATH SUITE="qemu" OPTS="-s -f -v"
8+
- PATH=$TRAVIS_BUILD_DIR/bin:$PATH SUITE="qira" OPTS="-s -f"
9+
- PATH=$TRAVIS_BUILD_DIR/bin:$PATH SUITE="afl" OPTS="-s -f"
610
install: (sudo apt-get update || true) && bin/manage-tools -s setup
711
script:
8-
- VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh manage-tools -s -v test z3
9-
- VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh manage-tools -s -v test qemu
10-
- VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh manage-tools -s -v test qira
11-
- VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh manage-tools -s -v test all
12+
- VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh manage-tools $OPTS test $SUITE

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Installers for the following tools are included:
99

1010
| Category | Tool | Description |
1111
|----------|------|-------------|
12-
| binary | [afl](http://lcamtuf.coredump.cx/afl/) | State-of-the-art fuzzer. | <!--tool--> <!--test-->
12+
| binary | [afl](http://lcamtuf.coredump.cx/afl/) | State-of-the-art fuzzer. | <!--tool--> <!--times-out-->
1313
| binary | [angr](http://angr.io) | Next-generation binary analysis engine from Shellphish. | <!--tool--> <!--no-test-->
1414
| binary | [barf](https://github.com/programa-stic/barf-project) | Binary Analysis and Reverse-engineering Framework. | <!--tool--><!--times-out-->
1515
| binary | [bindead](https://bitbucket.org/mihaila/bindead/wiki/Home) | A static analysis tool for binaries. | <!--tool--><!--failing-->
@@ -33,7 +33,7 @@ Installers for the following tools are included:
3333
| binary | [pwntools](https://github.com/Gallopsled/pwntools) | Useful CTF utilities. | <!--tool--><!--no-test-->
3434
| binary | [python-pin](https://github.com/blankwall/Python_Pin) | Python bindings for pin. | <!--tool--><!--test-->
3535
| binary | [qemu](http://qemu.org) | Latest version of qemu! | <!--tool--><!--times-out-->
36-
| binary | [qira](http://qira.me) | Parallel, timeless debugger. | <!--tool--><!--test-->
36+
| binary | [qira](http://qira.me) | Parallel, timeless debugger. | <!--tool--><!--times-out-->
3737
| binary | [radare2](http://www.radare.org/) | Some crazy thing crowell likes. | <!--tool--><!--test-->
3838
| binary | [ropper](https://github.com/sashs/Ropper) | Another gadget finder. | <!--tool--><!--test-->
3939
| binary | [rp++](https://github.com/0vercl0k/rp) | Another gadget finder. | <!--tool--><!--test-->
@@ -83,7 +83,7 @@ Installers for the following tools are included:
8383
| stego | [stegsolve](http://www.caesum.com/handbook/stego.htm) | Image steganography solver. | <!--tool--><!--test-->
8484
| android | [apktool](https://ibotpeaches.github.io/Apktool/) | Dissect, dis-assemble, and re-pack Android APKs | <!--tool--><!--test-->
8585
| android | [android-sdk](http://developer.android.com/sdk) | The android SDK (adb, emulator, etc). | <!--tool--><!--no-test-->
86-
| misc | [z3](https://github.com/Z3Prover/z3) | Theorem prover from Microsoft Research. | <!--tool--><!--test-->
86+
| misc | [z3](https://github.com/Z3Prover/z3) | Theorem prover from Microsoft Research. | <!--tool--><!--times-out-->
8787

8888
There are also some installers for non-CTF stuff to break the monotony!
8989

bin/manage-tools

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Usage: $(basename $0) [-sv] (list|setup|install|uninstall|bin|search) tool
1010
Where:
1111
-s allow running things with sudo (i.e., to install debs)
1212
-v verbose mode. print log while installing
13+
-f force certain actions (such as installing over an installed tool)
1314
tool the name of the tool. if "all", does the action on all tools
1415
1516
Actions:
@@ -159,6 +160,9 @@ do
159160
-s)
160161
export ALLOW_SUDO=1
161162
;;
163+
-f)
164+
export FORCE=1
165+
;;
162166
-v)
163167
export VERBOSE_OUTPUT=1
164168
;;
@@ -171,6 +175,7 @@ do
171175
done
172176

173177
[[ -z ${ALLOW_SUDO+x} ]] && export ALLOW_SUDO=0
178+
[[ -z ${FORCE+x} ]] && export FORCE=0
174179
[[ -z ${VERBOSE_OUTPUT+x} ]] && export VERBOSE_OUTPUT=0
175180

176181
if [[ $# -ge 1 ]]; then
@@ -218,7 +223,7 @@ case $ACTION in
218223
;;
219224
install)
220225
cd $TOOL
221-
if git status --ignored . | egrep -q 'Untracked|Ignored'
226+
if [ "$FORCE" -eq 0 ] && git status --ignored . | egrep -q 'Untracked|Ignored'
222227
then
223228
tool_log "appears to already be installed. Uninstall first?"
224229
exit 0
@@ -297,7 +302,7 @@ case $ACTION in
297302
cat README.md | grep "<\!--tool-->" | sed "s/<\!--[^-]*-->//g" | grep -i "$TOOL"
298303
;;
299304
test)
300-
if ! cat README.md | grep "<\!--tool-->" | grep "| \[$TOOL\](" | grep -q -- "--test--"
305+
if [ "$FORCE" -eq 0 ] && ! cat README.md | grep "<\!--tool-->" | grep "| \[$TOOL\](" | grep -q -- "--test--"
301306
then
302307
tool_log "Tests not enabled."
303308
else

0 commit comments

Comments
 (0)