Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Leap:15.2 checked in at 2020-02-10 16:41:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/libstorage-ng (Old) and /work/SRC/openSUSE:Leap:15.2/.libstorage-ng.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Mon Feb 10 16:41:20 2020 rev:224 rq:772187 version:4.2.60 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/libstorage-ng/libstorage-ng.changes 2020-02-04 17:55:07.588774881 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.libstorage-ng.new.26092/libstorage-ng.changes 2020-02-10 16:41:28.631704334 +0100 @@ -1,0 +2,21 @@ +Thu Feb 6 11:12:58 UTC 2020 - [email protected] + +- merge gh#openSUSE/libstorage-ng#705 +- fixed failure message +- 4.2.60 + +-------------------------------------------------------------------- +Wed Feb 5 09:50:07 UTC 2020 - [email protected] + +- merge gh#openSUSE/libstorage-ng#704 +- added being and end function to ProbeCallbacks +- extended documentation +- 4.2.59 + +-------------------------------------------------------------------- +Wed Feb 5 09:47:45 UTC 2020 - [email protected] + +- merge gh#openSUSE/libstorage-ng#703 +- Remove OutputProcessor class + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.2.58.tar.xz New: ---- libstorage-ng-4.2.60.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.DHeVjL/_old 2020-02-10 16:41:29.023704611 +0100 +++ /var/tmp/diff_new_pack.DHeVjL/_new 2020-02-10 16:41:29.027704614 +0100 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.2.58 +Version: 4.2.60 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.2.58.tar.xz -> libstorage-ng-4.2.60.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/LIBVERSION new/libstorage-ng-4.2.60/LIBVERSION --- old/libstorage-ng-4.2.58/LIBVERSION 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/LIBVERSION 2020-02-06 12:12:58.000000000 +0100 @@ -1 +1 @@ -1.26.0 +1.27.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/VERSION new/libstorage-ng-4.2.60/VERSION --- old/libstorage-ng-4.2.58/VERSION 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/VERSION 2020-02-06 12:12:58.000000000 +0100 @@ -1 +1 @@ -4.2.58 +4.2.60 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/bindings/storage.i new/libstorage-ng-4.2.60/bindings/storage.i --- old/libstorage-ng-4.2.58/bindings/storage.i 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/bindings/storage.i 2020-02-06 12:12:58.000000000 +0100 @@ -32,6 +32,7 @@ %feature("director") storage::ActivateCallbacksLuks; %feature("director") storage::ProbeCallbacks; %feature("director") storage::ProbeCallbacksV2; +%feature("director") storage::ProbeCallbacksV3; %feature("director") storage::CheckCallbacks; %feature("director") storage::CommitCallbacks; %feature("director") storage::RemoteCallbacks; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/doc/status.md new/libstorage-ng-4.2.60/doc/status.md --- old/libstorage-ng-4.2.58/doc/status.md 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/doc/status.md 2020-02-06 12:12:58.000000000 +0100 @@ -55,6 +55,10 @@ * Snapshots. +Not planned: + +* Cluster support. + Plain DM encryption ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/integration-tests/misc/probe.py new/libstorage-ng-4.2.60/integration-tests/misc/probe.py --- old/libstorage-ng-4.2.58/integration-tests/misc/probe.py 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/integration-tests/misc/probe.py 2020-02-06 12:12:58.000000000 +0100 @@ -8,11 +8,17 @@ from storageitu import * -class MyProbeCallbacks(ProbeCallbacksV2): +class MyProbeCallbacks(ProbeCallbacksV3): def __init__(self): super(MyProbeCallbacks, self).__init__() + def begin(self): + print("begin callback") + + def end(self): + print("end callback") + def message(self, message): print("message callback") print(message) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Devices/MdImpl.cc new/libstorage-ng-4.2.60/storage/Devices/MdImpl.cc --- old/libstorage-ng-4.2.58/storage/Devices/MdImpl.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Devices/MdImpl.cc 2020-02-06 12:12:58.000000000 +0100 @@ -422,7 +422,7 @@ catch (const Exception& exception) { // TRANSLATORS: error message - prober.handle(exception, sformat(_("Probing MD RAID %s failed")), UF_MDRAID); + prober.handle(exception, sformat(_("Probing MD RAID %s failed"), name), UF_MDRAID); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Storage.h new/libstorage-ng-4.2.60/storage/Storage.h --- old/libstorage-ng-4.2.58/storage/Storage.h 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Storage.h 2020-02-06 12:12:58.000000000 +0100 @@ -216,6 +216,25 @@ }; + class ProbeCallbacksV3 : public ProbeCallbacksV2 + { + public: + + virtual ~ProbeCallbacksV3() {} + + /** + * Called at the begin of probing. + */ + virtual void begin() const {} + + /** + * Called at the end of probing. + */ + virtual void end() const {} + + }; + + class CheckCallbacks { public: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/StorageImpl.cc new/libstorage-ng-4.2.60/storage/StorageImpl.cc --- old/libstorage-ng-4.2.58/storage/StorageImpl.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/StorageImpl.cc 2020-02-06 12:12:58.000000000 +0100 @@ -37,6 +37,7 @@ #include "storage/Prober.h" #include "storage/EnvironmentImpl.h" #include "storage/Utils/Format.h" +#include "storage/Utils/CallbacksImpl.h" namespace storage @@ -156,6 +157,8 @@ { y2mil("probe begin"); + CallbacksGuard callbacks_guard(probe_callbacks); + if (exist_devicegraph("probed")) remove_devicegraph("probed"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/CallbacksImpl.cc new/libstorage-ng-4.2.60/storage/Utils/CallbacksImpl.cc --- old/libstorage-ng-4.2.58/storage/Utils/CallbacksImpl.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/CallbacksImpl.cc 2020-02-06 12:12:58.000000000 +0100 @@ -30,6 +30,25 @@ namespace storage { + CallbacksGuard::CallbacksGuard(const Callbacks* callbacks) + : callbacks(callbacks) + { + const ProbeCallbacksV3* probe_callbacks_v3 = dynamic_cast<const ProbeCallbacksV3*>(callbacks); + + if (probe_callbacks_v3) + probe_callbacks_v3->begin(); + } + + + CallbacksGuard::~CallbacksGuard() + { + const ProbeCallbacksV3* probe_callbacks_v3 = dynamic_cast<const ProbeCallbacksV3*>(callbacks); + + if (probe_callbacks_v3) + probe_callbacks_v3->end(); + } + + void message_callback(const Callbacks* callbacks, const Text& message) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/CallbacksImpl.h new/libstorage-ng-4.2.60/storage/Utils/CallbacksImpl.h --- old/libstorage-ng-4.2.58/storage/Utils/CallbacksImpl.h 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/CallbacksImpl.h 2020-02-06 12:12:58.000000000 +0100 @@ -36,6 +36,24 @@ /** + * Calls the begin() and end() functions of the callbacks in the + * constructor respectively destructor. + */ + class CallbacksGuard + { + public: + + CallbacksGuard(const Callbacks* callbacks); + ~CallbacksGuard(); + + private: + + const Callbacks* callbacks; + + }; + + + /** * Call the message callback of callbacks. */ void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/Makefile.am new/libstorage-ng-4.2.60/storage/Utils/Makefile.am --- old/libstorage-ng-4.2.58/storage/Utils/Makefile.am 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/Makefile.am 2020-02-06 12:12:58.000000000 +0100 @@ -26,7 +26,6 @@ HumanString.h HumanString.cc \ Lock.cc Lock.h \ LockImpl.cc LockImpl.h \ - OutputProcessor.cc OutputProcessor.h \ Region.cc Region.h \ RegionImpl.cc RegionImpl.h \ Topology.cc Topology.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/OutputProcessor.cc new/libstorage-ng-4.2.60/storage/Utils/OutputProcessor.cc --- old/libstorage-ng-4.2.58/storage/Utils/OutputProcessor.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/OutputProcessor.cc 1970-01-01 01:00:00.000000000 +0100 @@ -1,165 +0,0 @@ -/* - * Copyright (c) [2004-2009] Novell, Inc. - * - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you may - * find current contact information at www.novell.com. - */ - - -#include "storage/Utils/LoggerImpl.h" -#include "storage/Utils/StorageTmpl.h" -#include "storage/Utils/OutputProcessor.h" - - -namespace storage -{ - using namespace std; - - -void -ProgressBar::setCurValue(unsigned val) - { - if( first || val!=cur ) - { - y2mil("val:" << val); - cur = val; - first = false; - if( callback ) - (*callback)( id, cur, max ); - } - } - -void -Mke2fsProgressBar::process(const string& val, bool stderr) - { - y2deb("val:" << val << " err:" << stderr << " done:" << done); - if( !stderr && !done ) - { - seen += val; - string::size_type pos; - string::size_type bpos; - if( !inode_tab ) - inode_tab = seen.find("Writing inode tables")!=string::npos; - bpos = (inode_tab?seen.find( "\b" ):string::npos); - if( inode_tab ) - bpos = seen.find( "\b" ); - while( !inode_tab && (pos=seen.find( "\n" )) != string::npos ) - seen.erase( 0, pos+1 ); - y2deb("first:" << first << " inode:" << inode_tab << " bpos:" << bpos); - while( inode_tab && bpos != string::npos ) - { - pos = seen.find_first_of( "0123456789" ); - y2deb("seen:" << seen); - if( pos != string::npos ) - { - string number = seen.substr( pos, bpos ); - y2deb("number:" << number); - list<string> l = splitString(number, "/" ); - list<string>::const_iterator i = l.begin(); - if( i != l.end() ) - { - unsigned cval; - *i++ >> cval; - if( first && i != l.end() ) - { - unsigned mx; - *i >> mx; - setMaxValue( mx+4 ); - setCurValue( 0 ); - first = false; - } - else if( !first ) - { - setCurValue( cval ); - } - } - } - seen.erase( 0, seen.find_first_not_of( "\b", bpos )); - bpos = seen.find( "\b" ); - } - if( inode_tab && seen.find( "done" )!=string::npos ) - { - setCurValue(getMaxValue() - 4); - done = true; - } - } - } - -void -ReiserProgressBar::process(const string& val, bool stderr) - { - y2deb("val:" << val << " err:" << stderr); - if( !stderr ) - { - seen += val; - string::size_type pos; - string::size_type bpos = seen.find( "Initializing" ); - while( first && (pos=seen.find( "\n" )) != string::npos && pos<bpos ) - { - seen.erase( 0, pos+1 ); - } - bpos = seen.find( "%" ); - while( bpos != string::npos ) - { - pos = seen.find_first_of( "0123456789" ); - if( pos != string::npos ) - seen.erase( 0, pos ); - y2deb("seen:" << seen); - string number = seen.substr( 0, bpos ); - y2deb("number:" << number); - unsigned cval; - number >> cval; - setCurValue( cval ); - seen.erase( 0, seen.find_first_not_of( "%.", bpos )); - bpos = seen.find( "%" ); - } - } - } - -void -DasdfmtProgressBar::process(const string& val, bool stderr) - { - y2deb("val:" << val << " err:" << stderr); - if( !stderr ) - { - seen += val; - string::size_type pos; - string::size_type bpos = seen.find( '|' ); - while( first && (pos=seen.find( '\n' )) != string::npos && pos<bpos ) - { - unsigned long cyl = 0; - seen >> cyl; - max_cyl += cyl; - y2mil( "cyl:" << cyl << " max_cyl:" << max_cyl); - seen.erase( 0, pos+1 ); - } - if( bpos != string::npos && max_cyl==0 ) - { - y2err("max_cyl is zero, this should not happen"); - max_cyl = 100; - } - while( bpos != string::npos ) - { - cur_cyl++; - setCurValue( cur_cyl*getMaxValue()/max_cyl ); - seen.erase( 0, bpos+1 ); - bpos = seen.find( "|" ); - } - } - } - -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/OutputProcessor.h new/libstorage-ng-4.2.60/storage/Utils/OutputProcessor.h --- old/libstorage-ng-4.2.58/storage/Utils/OutputProcessor.h 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/OutputProcessor.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,137 +0,0 @@ -/* - * Copyright (c) [2004-2009] Novell, Inc. - * - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you may - * find current contact information at www.novell.com. - */ - - -#ifndef STORAGE_OUTPUT_PROCESSOR_H -#define STORAGE_OUTPUT_PROCESSOR_H - - -#include <string> - - -namespace storage -{ - - using namespace std; - - - class OutputProcessor - { - public: - OutputProcessor() {} - virtual ~OutputProcessor() {} - virtual void reset() = 0; - virtual void finish() = 0; - virtual void process(const string& txt, bool stderr) = 0; - }; - - - typedef void (*CallbackProgressBar)(const string& id, unsigned cur, unsigned max); - - - class ProgressBar : public OutputProcessor - { - public: - ProgressBar(const string& id, CallbackProgressBar callback) - : id(id), callback(callback), first(true), max(100), cur(0) - {} - - virtual ~ProgressBar() {} - - virtual void reset() override { first = true; cur = 0; } - virtual void finish() override { setCurValue(max); } - virtual void process(const string& txt, bool stderr) override {} - - void setMaxValue(unsigned val) { max = val; } - unsigned getMaxValue() const { return max; } - void setCurValue(unsigned val); - unsigned getCurValue() const { return cur; } - - protected: - const string id; - const CallbackProgressBar callback; - - bool first; - - private: - unsigned long max; - unsigned long cur; - }; - - - class Mke2fsProgressBar : public ProgressBar - { - public: - Mke2fsProgressBar(CallbackProgressBar callback) - : ProgressBar("format", callback) - { - setMaxValue(100); - done = false; - inode_tab = false; - } - - virtual void process(const string& txt, bool stderr) override; - - protected: - string seen; - bool done; - bool inode_tab; - }; - - - class ReiserProgressBar : public ProgressBar - { - public: - ReiserProgressBar(CallbackProgressBar callback) - : ProgressBar("format", callback) - { - setMaxValue(100); - } - - virtual void process(const string& txt, bool stderr) override; - - protected: - string seen; - }; - - - class DasdfmtProgressBar : public ProgressBar - { - public: - DasdfmtProgressBar(CallbackProgressBar callback) - : ProgressBar("dasdfmt", callback) - { - setMaxValue(100); - max_cyl = cur_cyl = 0; - } - - virtual void process(const string& txt, bool stderr) override; - - protected: - string seen; - unsigned long max_cyl; - unsigned long cur_cyl; - }; - -} - - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/SystemCmd.cc new/libstorage-ng-4.2.60/storage/Utils/SystemCmd.cc --- old/libstorage-ng-4.2.58/storage/Utils/SystemCmd.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/SystemCmd.cc 2020-02-06 12:12:58.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2015] Novell, Inc. - * Copyright (c) [2016-2018] SUSE LLC + * Copyright (c) [2016-2020] SUSE LLC * * All Rights Reserved. * @@ -39,7 +39,6 @@ #include "storage/Utils/LoggerImpl.h" #include "storage/Utils/SystemCmd.h" #include "storage/Utils/Mockup.h" -#include "storage/Utils/OutputProcessor.h" #include "storage/Utils/StorageDefines.h" #include "storage/Utils/AppUtil.h" @@ -63,8 +62,7 @@ SystemCmd::SystemCmd(const Options& options) - : options(options), _combineOutput(false), _execInBackground(false), _cmdRet(0), - _cmdPid(0), _outputProc(nullptr) + : options(options), _combineOutput(false), _execInBackground(false), _cmdRet(0), _cmdPid(0) { y2mil("constructor SystemCmd(\"" << command() << "\")"); @@ -279,10 +277,6 @@ int SystemCmd::doExecute() { - if ( _outputProc ) - { - _outputProc->reset(); - } y2deb("command:" << command()); Stopwatch stopwatch; @@ -503,10 +497,6 @@ cmdRet_ret = -127; ST_MAYBE_THROW(SystemCmdException(this, "Command failed"), do_throw()); } - if ( _outputProc ) - { - _outputProc->finish(); - } } y2deb("Wait:" << waitpidRet << " pid:" << _cmdPid << " stat:" << cmdStatus << @@ -589,10 +579,6 @@ buffer[count] = 0; extractNewline( buffer, count, newLineSeen_ret, text, lines ); count = 0; - if ( _outputProc ) - { - _outputProc->process( buffer, isStderr ); - } } c = EOF; } @@ -600,10 +586,6 @@ { buffer[count] = 0; extractNewline( buffer, count, newLineSeen_ret, text, lines ); - if ( _outputProc ) - { - _outputProc->process( buffer, isStderr ); - } } if ( text.length() > 0 ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/storage/Utils/SystemCmd.h new/libstorage-ng-4.2.60/storage/Utils/SystemCmd.h --- old/libstorage-ng-4.2.58/storage/Utils/SystemCmd.h 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/storage/Utils/SystemCmd.h 2020-02-06 12:12:58.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2015] Novell, Inc. - * Copyright (c) [2016-2018] SUSE LLC + * Copyright (c) [2016-2020] SUSE LLC * * All Rights Reserved. * @@ -41,8 +41,6 @@ using std::string; using std::vector; - class OutputProcessor; - /** * Class to invoke a shell command and capture its exit value and output. @@ -146,13 +144,6 @@ int executeRestricted(unsigned long maxTimeSec, unsigned long maxLineOut, bool& timeExceeded_ret, bool& linesExceeded_ret); - /** - * Set an OutputProcessor. This is mostly useful for visual feedback to - * the user (progress bar, busy animation). The OutputProcessor is - * called when an output line is read. See OutputProcessor.h. - */ - void setOutputProcessor(OutputProcessor* proc) { _outputProc = proc; } - public: /** @@ -226,7 +217,6 @@ bool _execInBackground; int _cmdRet; int _cmdPid; - OutputProcessor* _outputProc; struct pollfd _pfds[3]; /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/testsuite/helpers/CallbacksRecorder.cc new/libstorage-ng-4.2.60/testsuite/helpers/CallbacksRecorder.cc --- old/libstorage-ng-4.2.58/testsuite/helpers/CallbacksRecorder.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/testsuite/helpers/CallbacksRecorder.cc 2020-02-06 12:12:58.000000000 +0100 @@ -8,13 +8,25 @@ namespace storage { + void + ProbeCallbacksRecorder::begin() const + { + messages.push_back("begin:"); + } + + + void + ProbeCallbacksRecorder::end() const + { + messages.push_back("end:"); + } + + bool ProbeCallbacksRecorder::error(const string& message, const string& what) const { messages.push_back("error: message = '" + message + "', what = '" + what + "'"); - sort(messages.begin(), messages.end()); - return true; } @@ -26,8 +38,6 @@ messages.push_back("missing-command: message = '" + message + "', what = '" + what + "', " "command = '" + command + "', used_features = " + to_string(used_features)); - sort(messages.begin(), messages.end()); - return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/testsuite/helpers/CallbacksRecorder.h new/libstorage-ng-4.2.60/testsuite/helpers/CallbacksRecorder.h --- old/libstorage-ng-4.2.58/testsuite/helpers/CallbacksRecorder.h 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/testsuite/helpers/CallbacksRecorder.h 2020-02-06 12:12:58.000000000 +0100 @@ -11,12 +11,16 @@ using namespace std; - class ProbeCallbacksRecorder : public ProbeCallbacksV2 + class ProbeCallbacksRecorder : public ProbeCallbacksV3 { public: ProbeCallbacksRecorder(vector<string>& messages) : messages(messages) { messages.clear(); } + virtual void begin() const override; + + virtual void end() const override; + virtual void message(const std::string& message) const override {} virtual bool error(const string& message, const std::string& what) const override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/testsuite/probe/ambiguous1.cc new/libstorage-ng-4.2.60/testsuite/probe/ambiguous1.cc --- old/libstorage-ng-4.2.58/testsuite/probe/ambiguous1.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/testsuite/probe/ambiguous1.cc 2020-02-06 12:12:58.000000000 +0100 @@ -33,9 +33,11 @@ Storage storage(environment); storage.probe(&probe_callbacks_recorder); - BOOST_REQUIRE_EQUAL(probe_messages.size(), 1); - BOOST_CHECK_EQUAL(probe_messages[0], "error: message = 'Detected a file system next to a partition table on the\n" + BOOST_REQUIRE_EQUAL(probe_messages.size(), 3); + BOOST_CHECK_EQUAL(probe_messages[0], "begin:"); + BOOST_CHECK_EQUAL(probe_messages[1], "error: message = 'Detected a file system next to a partition table on the\n" "device /dev/sda. The file system will be ignored.', what = ''"); + BOOST_CHECK_EQUAL(probe_messages[2], "end:"); const Devicegraph* probed = storage.get_probed(); probed->check(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/testsuite/probe/error1.cc new/libstorage-ng-4.2.60/testsuite/probe/error1.cc --- old/libstorage-ng-4.2.58/testsuite/probe/error1.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/testsuite/probe/error1.cc 2020-02-06 12:12:58.000000000 +0100 @@ -28,8 +28,10 @@ Storage storage(environment); storage.probe(&probe_callbacks_recorder); - BOOST_REQUIRE_EQUAL(probe_messages.size(), 1); - BOOST_CHECK_EQUAL(probe_messages[0], "error: message = 'Probing LVM failed', what = 'command '/sbin/pvs " + BOOST_REQUIRE_EQUAL(probe_messages.size(), 3); + BOOST_CHECK_EQUAL(probe_messages[0], "begin:"); + BOOST_CHECK_EQUAL(probe_messages[1], "error: message = 'Probing LVM failed', what = 'command '/sbin/pvs " "--reportformat json --units b --nosuffix --all --options pv_name,pv_uuid,vg_name,vg_uuid," "pv_attr,pe_start' failed:\n\nstderr:\nerror: system is screwed\n\nexit code:\n42'"); + BOOST_CHECK_EQUAL(probe_messages[2], "end:"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/testsuite/probe/lvm-unsupported1.cc new/libstorage-ng-4.2.60/testsuite/probe/lvm-unsupported1.cc --- old/libstorage-ng-4.2.58/testsuite/probe/lvm-unsupported1.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/testsuite/probe/lvm-unsupported1.cc 2020-02-06 12:12:58.000000000 +0100 @@ -31,11 +31,13 @@ Storage storage(environment); storage.probe(&probe_callbacks_recorder); - BOOST_REQUIRE_EQUAL(probe_messages.size(), 1); - BOOST_CHECK_EQUAL(probe_messages[0], "error: message = 'Detected LVM logical volumes of unsupported types:\n\n" + BOOST_REQUIRE_EQUAL(probe_messages.size(), 3); + BOOST_CHECK_EQUAL(probe_messages[0], "begin:"); + BOOST_CHECK_EQUAL(probe_messages[1], "error: message = 'Detected LVM logical volumes of unsupported types:\n\n" "/dev/test/cached\n/dev/test/normal1\n/dev/test/normal1-snapshot\n\n" "These logical volumes are ignored. Operations on the\ncorreponding volume " "groups may fail.', what = ''"); + BOOST_CHECK_EQUAL(probe_messages[2], "end:"); const Devicegraph* probed = storage.get_probed(); probed->check(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.2.58/testsuite/probe/missing1.cc new/libstorage-ng-4.2.60/testsuite/probe/missing1.cc --- old/libstorage-ng-4.2.58/testsuite/probe/missing1.cc 2020-02-03 15:34:59.000000000 +0100 +++ new/libstorage-ng-4.2.60/testsuite/probe/missing1.cc 2020-02-06 12:12:58.000000000 +0100 @@ -28,8 +28,10 @@ Storage storage(environment); storage.probe(&probe_callbacks_recorder); - BOOST_REQUIRE_EQUAL(probe_messages.size(), 1); - BOOST_CHECK_EQUAL(probe_messages[0], "missing-command: message = 'Probing file systems failed', " + BOOST_REQUIRE_EQUAL(probe_messages.size(), 3); + BOOST_CHECK_EQUAL(probe_messages[0], "begin:"); + BOOST_CHECK_EQUAL(probe_messages[1], "missing-command: message = 'Probing file systems failed', " "what = 'Command not found: \"/sbin/btrfs filesystem show\"', " "command = '/sbin/btrfs filesystem show', used_features = 8"); + BOOST_CHECK_EQUAL(probe_messages[2], "end:"); }
