-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract unit tests to a separate module
related to: #5 - Load balancing
- Loading branch information
Showing
9 changed files
with
98 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Tempesta FW | ||
* | ||
* Copyright (C) 2012-2014 NatSys Lab. (info@natsys-lab.com). | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, | ||
* or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 | ||
* Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
|
||
#include "tempesta.h" | ||
#include "test.h" | ||
|
||
MODULE_AUTHOR(TFW_AUTHOR); | ||
MODULE_DESCRIPTION("Tempesta FW tests"); | ||
MODULE_VERSION("0.0.1"); | ||
MODULE_LICENSE("GPL"); | ||
|
||
static int __init | ||
tfw_test_init(void) | ||
{ | ||
int fail_count = 0; | ||
|
||
printk("tfw_test: start\n"); | ||
fail_count = run_all_tests(); | ||
|
||
printk("tfw_test: finish - "); | ||
if (fail_count) | ||
printk("failed %d assertions\n", fail_count); | ||
else | ||
printk("all passed\n"); | ||
|
||
return 0; | ||
} | ||
|
||
void | ||
tfw_test_exit(void) | ||
{ | ||
} | ||
|
||
module_init(tfw_test_init); | ||
module_exit(tfw_test_exit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# | ||
# A script that simply runs all tests for Tempesta FW. | ||
# | ||
# 2012-2014. Written by NatSys Lab. (info@natsys-lab.com). | ||
|
||
insmod $(dirname $0)/tfw_test.ko | ||
rmmod tfw_test | ||
dmesg | tac | grep -m 1 -B 200 "tfw_test: start" | tac |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters