mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-02 15:05:16 +00:00
[#2136] fix unit test error messages
This commit is contained in:
committed by
Razvan Becheriu
parent
424c428130
commit
d4e3381fa5
@@ -32,11 +32,8 @@ string missingModuleText(const string& name, const string& revision) {
|
|||||||
stringstream tmp;
|
stringstream tmp;
|
||||||
tmp << "ERROR: YANG module " << name << " is not installed." << endl
|
tmp << "ERROR: YANG module " << name << " is not installed." << endl
|
||||||
<< "The environment is not suitable for running unit tests." << endl
|
<< "The environment is not suitable for running unit tests." << endl
|
||||||
<< "Please locate " << name << "@" << revision << ".yang, "
|
<< "Please install the module " << name << ":" << endl
|
||||||
<< "change to its directory and issue the following command:" << endl
|
<< "$ sysrepoctl -i ./src/share/yang/modules/" << name << "@" << revision << ".yang" << endl
|
||||||
<< endl
|
|
||||||
<< "sysrepoctl -i " << name << "@" << revision << ".yang" << endl
|
|
||||||
<< endl
|
|
||||||
<< endl;
|
<< endl;
|
||||||
return (tmp.str());
|
return (tmp.str());
|
||||||
}
|
}
|
||||||
@@ -50,16 +47,13 @@ string missingModuleText(const string& name, const string& revision) {
|
|||||||
string badRevisionModuleText(const string& name, const string& expected,
|
string badRevisionModuleText(const string& name, const string& expected,
|
||||||
const string& got) {
|
const string& got) {
|
||||||
stringstream tmp;
|
stringstream tmp;
|
||||||
tmp << "ERROR: YANG module " << name << " is not installed with the right "
|
tmp << endl
|
||||||
<< "revision: expected " << expected << " but got " << got << endl
|
<< "ERROR: YANG module " << name << " is not installed with the right "
|
||||||
<< "Please remove the module " << name << " and re-install it: "
|
<< "revision: got " << got << ", but expected " << expected << "." << endl
|
||||||
<< "Please locate " << name << "@" << expected << ".yang, " << endl
|
<< "Please remove the module " << name << " and reinstall it: " << endl
|
||||||
<< "change to its directory and issue the following commands:"
|
<< "$ sysrepoctl -u " << name << endl
|
||||||
<< endl << endl
|
<< "$ sysrepoctl -i ./src/share/yang/modules/" << name << "@" << expected << ".yang" << endl
|
||||||
<< "# sysrepoctl -u -m " << name << endl
|
<< endl;
|
||||||
<< "# sysrepoctl -i -s " << REPOSITORY << "/yang "
|
|
||||||
<< "-s . -g " << name << "@" << expected << ".yang" << endl
|
|
||||||
<< endl << endl;
|
|
||||||
return (tmp.str());
|
return (tmp.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,12 +110,12 @@ int main() {
|
|||||||
|
|
||||||
for (auto const& kv : YANG_REVISIONS) {
|
for (auto const& kv : YANG_REVISIONS) {
|
||||||
std::string const& name(kv.first);
|
std::string const& name(kv.first);
|
||||||
std::string const& revision(kv.second);
|
std::string const& expected_revision(kv.second);
|
||||||
if (!installed_modules.count(name)) {
|
if (!installed_modules.count(name)) {
|
||||||
cerr << missingModuleText(name, revision);
|
cerr << missingModuleText(name, expected_revision);
|
||||||
return (6);
|
return (6);
|
||||||
}
|
}
|
||||||
string const& expected_revision(installed_modules.at(name));
|
string const& revision(installed_modules.at(name));
|
||||||
if (expected_revision != revision) {
|
if (expected_revision != revision) {
|
||||||
cerr << badRevisionModuleText(name, expected_revision, revision);
|
cerr << badRevisionModuleText(name, expected_revision, revision);
|
||||||
return (7);
|
return (7);
|
||||||
|
Reference in New Issue
Block a user