提交 0680a253 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix issue

上级 d28183f0
>> Usage:
>> 3
>> 'a,b,c'
>> output.txt
>> '1,3,5'
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=basic
cid=0
pid=0
[group]
1. usage output >>
2. basic output >>
3. step output >>
[esac]
*/
$output = [];
exec('./zd-mac -h', $output);
print(">> $output[0]\n");
$output = [];
exec('./zd-mac -y ../test/definition/basic.yaml -c 3 -field basic -o ../test/output/output.txt -f text', $output);
$count = sprintf("%d", count($output));
print(">> $count\n");
print(">> $output[0]\n");
$output = [];
exec('ls ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
$output = [];
exec('./zd-mac -y ../test/definition/basic.yaml -c 7 -field step -o ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
>> 2, 1.100, char is c
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=defferent data type with format
cid=0
pid=0
[group]
1. defferent data type with format >>
[esac]
*/
$output = [];
exec('./zd-mac -y ../test/definition/format.yaml -c 3 -field int,float,char -o ../test/output/output.txt -f text', $output);
print(">> $output[1]\n");
\ No newline at end of file
>> {a b}
>> ='1,2' '3,4'-
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=field
cid=0
pid=0
[group]
1. inherit from basic field >>
2. inherit from reference field >>
[esac]
*/
$output = [];
exec('./zd-mac -d ../test/definition/basic.yaml -y ../test/definition/inherit.yaml -c 3 -field basic -o ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
$output = [];
exec('./zd-mac -d ../test/definition/refer.yaml -y ../test/definition/inherit.yaml -c 3 -field refer2 -o ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
>> '192.168.0.1-192.168.1.2'
\ No newline at end of file
>> 6
>> is random
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=random
cid=0
pid=0
[group]
1. output >>
[esac]
*/
$output = [];
exec('./zd-mac -y ../test/definition/basic.yaml -c 7 -field random -o ../test/output/output.txt -f text', $output);
$line = $output[0];
print("Got $line\n");
// 1,2,2,2,8,1
$numbs = explode(",", $line);
$count = sprintf("%d", count($numbs));
print(">> $count\n");
$result = 'not random';
$i = 0;
for($i = 0; $i < $count; $i++) {
if ($numbs[$i] != $i + 1) { // at lease one not equal sequence numb 1,2,3,4,5,6
$result = 'is random';
break;
}
}
print(">> $result\n");
\ No newline at end of file
>> '192.168.0.1-192.168.1.2'
\ No newline at end of file
#!/usr/bin/env php
<?php
/**
[case]
title=reference
cid=0
pid=0
[group]
1. output >>
[esac]
*/
$output = [];
exec('./zd-mac -y ../test/definition/refer.yaml -c 7 -field refer -o ../test/output/output.txt -f text', $output);
print(">> $output[0]\n");
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册