From: Francis Dupont Date: Tue, 25 Sep 2018 10:44:22 +0000 (+0200) Subject: [65-libyang-config-build] Moved daemon required test at the end X-Git-Tag: 65-libyang-class_base~1^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4121814f872c18cb055c17a953c480a5d02ab9e;p=thirdparty%2Fkea.git [65-libyang-config-build] Moved daemon required test at the end --- diff --git a/src/lib/yang/pretests/sysrepo_setup_tests.cc b/src/lib/yang/pretests/sysrepo_setup_tests.cc index 7a4e592c48..f385ab858f 100644 --- a/src/lib/yang/pretests/sysrepo_setup_tests.cc +++ b/src/lib/yang/pretests/sysrepo_setup_tests.cc @@ -39,12 +39,12 @@ string missingModuleText(const string& name) { /// @brief Checks sysrepo setup: /// - connection establishment -/// - daemon required /// - session establishment /// - test module /// - type modules /// - IETF module /// - Kea modules. +/// - daemon required int main() { S_Connection conn; try { @@ -53,31 +53,24 @@ int main() { cerr << "ERROR: Can't connect to sysrepo: " << ex.what() << endl; exit(-1); } - try { - conn.reset(new Connection("sysrepo setup check", - SR_CONN_DAEMON_REQUIRED)); - } catch (const sysrepo_exception& ex) { - cerr <<"ERROR: Can't connect to sysrepo daemon: " <list_schemas(); } catch (const sysrepo_exception& ex) { cerr << "ERROR: Can't list available schemas: " << ex.what() << endl; - exit(-4); + exit(-3); } + bool found_test = false; bool found_ietf_types = false; bool found_yang_types =false; @@ -111,13 +104,12 @@ int main() { } } - int exit_code = 0; if (!found_test || !found_ietf_types || !found_yang_types || !found_ietf || !found_kea4 || !found_kea6 || !found_keaca || !found_kea2) { - exit_code = 4; + exit_code = -4; } if (!found_test) { @@ -160,5 +152,17 @@ int main() { --exit_code; } + try { + sess.reset(); + conn.reset(new Connection("sysrepo setup check", + SR_CONN_DAEMON_REQUIRED)); + } catch (const sysrepo_exception& ex) { + cerr <<"ERROR: Can't connect to sysrepo daemon: " <