[test suite] trigger a couple of -p errors for code coverage

This commit is contained in:
Michael Rash
2016-05-24 19:00:58 -07:00
parent 4122199139
commit 08c6a9d4e2
2 changed files with 22 additions and 3 deletions
+1 -3
View File
@@ -1142,11 +1142,9 @@ count_characters(const char *str, const char match, int len)
{
int i, count = 0;
for (i=0; i < len; i++) {
for (i=0; i < len && str[i] != '\0'; i++) {
if (str[i] == match)
count++;
if (str[i] == '\0')
return count;
}
return count;
}
+21
View File
@@ -192,6 +192,27 @@
'exec_err' => $YES,
'cmdline' => "$fwknopCmd -A tcp/600001 -a $fake_ip -D $loopback_ip",
},
### trigger strtol() error
{
'category' => 'basic operations',
'subcategory' => 'client',
'detail' => 'invalid SPA destination port (1)',
'function' => \&generic_exec,
'exec_err' => $YES,
'cmdline' => "$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip -p 9999999999999999999999999999999999999999999999999999999999",
},
### trigger MAX_PORT error
{
'category' => 'basic operations',
'subcategory' => 'client',
'detail' => 'invalid SPA destination port (2)',
'function' => \&generic_exec,
'exec_err' => $YES,
'cmdline' => "$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip -p 99999",
},
{
'category' => 'basic operations',
'subcategory' => 'client',