mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
added unittest for yaml export
This commit is contained in:
@@ -313,7 +313,7 @@ void pcpexport_yaml(char *outfile) {
|
|||||||
fprintf(out, "secret-keys:\n");
|
fprintf(out, "secret-keys:\n");
|
||||||
|
|
||||||
for(s=pcpkey_hash; s != NULL; s=(pcp_key_t*)(s->hh.next)) {
|
for(s=pcpkey_hash; s != NULL; s=(pcp_key_t*)(s->hh.next)) {
|
||||||
fprintf(out, "-\n");
|
fprintf(out, " -\n");
|
||||||
fprintf(out, " id: %s\n", s->id);
|
fprintf(out, " id: %s\n", s->id);
|
||||||
fprintf(out, " owner: %s\n", s->owner);
|
fprintf(out, " owner: %s\n", s->owner);
|
||||||
fprintf(out, " mail: %s\n", s->mail);
|
fprintf(out, " mail: %s\n", s->mail);
|
||||||
@@ -333,13 +333,11 @@ void pcpexport_yaml(char *outfile) {
|
|||||||
fprintf(out, " secret: "); pcpprint_bin(out, s->secret, 32); fprintf(out, "\n");
|
fprintf(out, " secret: "); pcpprint_bin(out, s->secret, 32); fprintf(out, "\n");
|
||||||
}
|
}
|
||||||
fprintf(out, " edpub: "); pcpprint_bin(out, s->edpub, 32); fprintf(out, "\n");
|
fprintf(out, " edpub: "); pcpprint_bin(out, s->edpub, 32); fprintf(out, "\n");
|
||||||
|
|
||||||
fprintf(out, "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(out, "public-keys:\n");
|
fprintf(out, "public-keys:\n");
|
||||||
for(p=pcppubkey_hash; p != NULL; p=(pcp_pubkey_t*)(p->hh.next)) {
|
for(p=pcppubkey_hash; p != NULL; p=(pcp_pubkey_t*)(p->hh.next)) {
|
||||||
fprintf(out, "-\n");
|
fprintf(out, " -\n");
|
||||||
fprintf(out, " id: %s\n", p->id);
|
fprintf(out, " id: %s\n", p->id);
|
||||||
fprintf(out, " owner: %s\n", p->owner);
|
fprintf(out, " owner: %s\n", p->owner);
|
||||||
fprintf(out, " mail: %s\n", p->mail);
|
fprintf(out, " mail: %s\n", p->mail);
|
||||||
@@ -349,7 +347,6 @@ void pcpexport_yaml(char *outfile) {
|
|||||||
fprintf(out, " type: public\n");
|
fprintf(out, " type: public\n");
|
||||||
fprintf(out, " public: "); pcpprint_bin(out, p->public, 32); fprintf(out, "\n");
|
fprintf(out, " public: "); pcpprint_bin(out, p->public, 32); fprintf(out, "\n");
|
||||||
fprintf(out, " edpub: "); pcpprint_bin(out, p->edpub, 32); fprintf(out, "\n");
|
fprintf(out, " edpub: "); pcpprint_bin(out, p->edpub, 32); fprintf(out, "\n");
|
||||||
fprintf(out, "\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,12 @@ dxmorg@florida.cops.gov
|
|||||||
expect = /verified/
|
expect = /verified/
|
||||||
</test>
|
</test>
|
||||||
|
|
||||||
|
#
|
||||||
|
# yaml export test
|
||||||
|
<test check-export-yaml>
|
||||||
|
cmd = $pcp -V va -y | perl -MYAML -MData::Dumper -e "print Dumper(Load(join('',<>)))"
|
||||||
|
expect = /VAR1/
|
||||||
|
</test>
|
||||||
|
|
||||||
#
|
#
|
||||||
# negative tests, check for error handling
|
# negative tests, check for error handling
|
||||||
|
|||||||
Reference in New Issue
Block a user