Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2022-10-28 19:29:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Fri Oct 28 19:29:45 2022 rev:185 rq:1031927 version:4.5.48 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2022-10-22 14:12:00.296584133 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.2275/libstorage-ng.changes 2022-10-28 19:30:15.286849308 +0200 @@ -1,0 +2,7 @@ +Fri Oct 28 10:32:37 UTC 2022 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#901 +- set used feature flag for quota (bsc#1204773) +- 4.5.48 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.5.47.tar.xz New: ---- libstorage-ng-4.5.48.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.92bmTO/_old 2022-10-28 19:30:16.498855386 +0200 +++ /var/tmp/diff_new_pack.92bmTO/_new 2022-10-28 19:30:16.518855486 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.5.47 +Version: 4.5.48 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.5.47.tar.xz -> libstorage-ng-4.5.48.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/LIBVERSION new/libstorage-ng-4.5.48/LIBVERSION --- old/libstorage-ng-4.5.47/LIBVERSION 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/LIBVERSION 2022-10-28 12:32:37.000000000 +0200 @@ -1 +1 @@ -1.81.1 +1.82.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/VERSION new/libstorage-ng-4.5.48/VERSION --- old/libstorage-ng-4.5.47/VERSION 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/VERSION 2022-10-28 12:32:37.000000000 +0200 @@ -1 +1 @@ -4.5.47 +4.5.48 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/configure.ac new/libstorage-ng-4.5.48/configure.ac --- old/libstorage-ng-4.5.47/configure.ac 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/configure.ac 2022-10-28 12:32:37.000000000 +0200 @@ -133,6 +133,7 @@ testsuite/Devices/Makefile testsuite/freeinfo/Makefile testsuite/performance/Makefile + testsuite/used-features/Makefile testsuite/commented-config-file/Makefile testsuite/CompoundAction/Makefile integration-tests/Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/ActiongraphImpl.cc new/libstorage-ng-4.5.48/storage/ActiongraphImpl.cc --- old/libstorage-ng-4.5.47/storage/ActiongraphImpl.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/ActiongraphImpl.cc 2022-10-28 12:32:37.000000000 +0200 @@ -229,6 +229,8 @@ ret |= action->used_features(*this); } + y2mil("used-features " << get_used_features_names(ret)); + return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/DevicegraphImpl.cc new/libstorage-ng-4.5.48/storage/DevicegraphImpl.cc --- old/libstorage-ng-4.5.47/storage/DevicegraphImpl.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/DevicegraphImpl.cc 2022-10-28 12:32:37.000000000 +0200 @@ -37,6 +37,7 @@ #include "storage/Holders/Holder.h" #include "storage/StorageImpl.h" #include "storage/Utils/Format.h" +#include "storage/Utils/LoggerImpl.h" #include "storage/GraphvizImpl.h" #include "storage/Registries.h" @@ -259,6 +260,9 @@ ret |= device->get_impl().used_features(used_features_dependency_type); } + y2mil("used-features " << get_used_features_dependency_type_name(used_features_dependency_type) << + " " << get_used_features_names(ret)); + return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/Filesystems/ExtImpl.cc new/libstorage-ng-4.5.48/storage/Filesystems/ExtImpl.cc --- old/libstorage-ng-4.5.47/storage/Filesystems/ExtImpl.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/Filesystems/ExtImpl.cc 2022-10-28 12:32:37.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. - * Copyright (c) [2016-2021] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -27,6 +27,7 @@ #include "storage/Devices/BlkDeviceImpl.h" #include "storage/Holders/FilesystemUser.h" #include "storage/Filesystems/ExtImpl.h" +#include "storage/Filesystems/MountPoint.h" #include "storage/SystemInfo/SystemInfoImpl.h" #include "storage/SystemInfo/CmdDumpe2fs.h" #include "storage/SystemInfo/CmdResize2fs.h" @@ -48,6 +49,22 @@ } + uf_t + Ext::Impl::used_features_pure(const MountPoint* mount_point) const + { + static const regex rx1("(usr||grp|prj)quota", regex::extended); + static const regex rx2("(usr|grp)jquota=.+", regex::extended); + + for (const string& mount_option : mount_point->get_mount_options()) + { + if (regex_match(mount_option, rx1) || regex_match(mount_option, rx2)) + return UF_QUOTA; + } + + return 0; + } + + void Ext::Impl::probe_pass_2b(Prober& prober) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/Filesystems/ExtImpl.h new/libstorage-ng-4.5.48/storage/Filesystems/ExtImpl.h --- old/libstorage-ng-4.5.47/storage/Filesystems/ExtImpl.h 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/Filesystems/ExtImpl.h 2022-10-28 12:32:37.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. - * Copyright (c) [2016-2021] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -58,6 +58,8 @@ virtual bool supports_uuid() const override { return true; } virtual bool supports_modify_uuid() const override { return true; } + virtual uf_t used_features_pure(const MountPoint* mount_point) const override; + virtual void probe_pass_2b(Prober& prober) override; unsigned long long max_size(unsigned long block_size, bool feature_64bit) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/Filesystems/MountPointImpl.cc new/libstorage-ng-4.5.48/storage/Filesystems/MountPointImpl.cc --- old/libstorage-ng-4.5.47/storage/Filesystems/MountPointImpl.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/Filesystems/MountPointImpl.cc 2022-10-28 12:32:37.000000000 +0200 @@ -313,6 +313,8 @@ if (active || in_etc_fstab) ret |= get_mountable()->get_impl().used_features_pure(); + ret |= get_mountable()->get_impl().used_features_pure(get_non_impl()); + return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/Filesystems/MountableImpl.h new/libstorage-ng-4.5.48/storage/Filesystems/MountableImpl.h --- old/libstorage-ng-4.5.47/storage/Filesystems/MountableImpl.h 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/Filesystems/MountableImpl.h 2022-10-28 12:32:37.000000000 +0200 @@ -206,6 +206,7 @@ virtual uf_t used_features(UsedFeaturesDependencyType used_features_dependency_type) const override; virtual uf_t used_features_pure() const = 0; + virtual uf_t used_features_pure(const MountPoint* mount_point) const { return 0; } virtual uf_t do_create_used_features() const override { return used_features_pure(); } virtual uf_t do_resize_used_features() const override { return used_features_pure(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/Filesystems/XfsImpl.cc new/libstorage-ng-4.5.48/storage/Filesystems/XfsImpl.cc --- old/libstorage-ng-4.5.47/storage/Filesystems/XfsImpl.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/Filesystems/XfsImpl.cc 2022-10-28 12:32:37.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) 2015 Novell, Inc. - * Copyright (c) [2016-2021] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -24,6 +24,7 @@ #include "storage/Devices/BlkDeviceImpl.h" #include "storage/Holders/FilesystemUser.h" #include "storage/Filesystems/XfsImpl.h" +#include "storage/Filesystems/MountPoint.h" #include "storage/Devicegraph.h" #include "storage/Utils/StorageDefines.h" #include "storage/Utils/SystemCmd.h" @@ -47,6 +48,22 @@ } + uf_t + Xfs::Impl::used_features_pure(const MountPoint* mount_point) const + { + static const regex rx1("(u|usr||g|grp|p|prj)quota", regex::extended); + static const regex rx2("(u||g|p)qnoenforce", regex::extended); + + for (const string& mount_option : mount_point->get_mount_options()) + { + if (regex_match(mount_option, rx1) || regex_match(mount_option, rx2)) + return UF_QUOTA; + } + + return 0; + } + + string Xfs::Impl::get_pretty_classname() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/Filesystems/XfsImpl.h new/libstorage-ng-4.5.48/storage/Filesystems/XfsImpl.h --- old/libstorage-ng-4.5.47/storage/Filesystems/XfsImpl.h 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/Filesystems/XfsImpl.h 2022-10-28 12:32:37.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. - * Copyright (c) [2016-2021] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -62,6 +62,8 @@ virtual bool supports_external_journal() const override { return true; } + virtual uf_t used_features_pure(const MountPoint* mount_point) const override; + public: Impl() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/UsedFeatures.cc new/libstorage-ng-4.5.48/storage/UsedFeatures.cc --- old/libstorage-ng-4.5.47/storage/UsedFeatures.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/UsedFeatures.cc 2022-10-28 12:32:37.000000000 +0200 @@ -25,6 +25,7 @@ #include <boost/algorithm/string.hpp> #include "storage/UsedFeatures.h" +#include "storage/Utils/Enum.h" namespace storage @@ -33,6 +34,20 @@ using namespace std; + template <> struct EnumTraits<UsedFeaturesDependencyType> { static const vector<string> names; }; + + const vector<string> EnumTraits<UsedFeaturesDependencyType>::names({ + "REQUIRED", "SUGGESTED" + }); + + + string + get_used_features_dependency_type_name(UsedFeaturesDependencyType used_features_dependency_type) + { + return toString(used_features_dependency_type); + } + + string get_used_features_names(uf_t used_features) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/storage/UsedFeatures.h new/libstorage-ng-4.5.48/storage/UsedFeatures.h --- old/libstorage-ng-4.5.47/storage/UsedFeatures.h 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/storage/UsedFeatures.h 2022-10-28 12:32:37.000000000 +0200 @@ -50,6 +50,14 @@ /** + * Convert the UsedFeaturesDependencyType used_features_dependency_type to a string. + * + * @see UsedFeaturesDependencyType + */ + std::string get_used_features_dependency_type_name(UsedFeaturesDependencyType used_features_dependency_type); + + + /** * Type for used features. */ using uf_t = uint64_t; @@ -90,7 +98,9 @@ UF_PMEM = 1 << 29, UF_NVME = 1 << 28, + /** Quota for ext4 or xfs. Not for btrfs. */ UF_QUOTA = 1 << 21, + UF_SNAPSHOTS = 1 << 22 }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/Makefile.am new/libstorage-ng-4.5.48/testsuite/Makefile.am --- old/libstorage-ng-4.5.47/testsuite/Makefile.am 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/testsuite/Makefile.am 2022-10-28 12:32:37.000000000 +0200 @@ -4,7 +4,7 @@ SUBDIRS = helpers . Utils SystemInfo probe dependencies sorting \ freeinfo Devices partitions performance style commented-config-file \ - CompoundAction + used-features CompoundAction AM_CPPFLAGS = -I$(top_srcdir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/helpers/CallbacksRecorder.cc new/libstorage-ng-4.5.48/testsuite/helpers/CallbacksRecorder.cc --- old/libstorage-ng-4.5.47/testsuite/helpers/CallbacksRecorder.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/testsuite/helpers/CallbacksRecorder.cc 2022-10-28 12:32:37.000000000 +0200 @@ -35,7 +35,7 @@ bool ProbeCallbacksRecorder::missing_command(const string& message, const string& what, - const string& command, uint64_t used_features) const + const string& command, uf_t used_features) const { messages.push_back("missing-command: message = '" + message + "', what = '" + what + "', " "command = '" + command + "', used-features = " + to_string(used_features)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/helpers/CallbacksRecorder.h new/libstorage-ng-4.5.48/testsuite/helpers/CallbacksRecorder.h --- old/libstorage-ng-4.5.47/testsuite/helpers/CallbacksRecorder.h 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/testsuite/helpers/CallbacksRecorder.h 2022-10-28 12:32:37.000000000 +0200 @@ -4,6 +4,7 @@ #include <vector> #include "storage/Storage.h" +#include "storage/UsedFeatures.h" namespace storage @@ -26,7 +27,7 @@ virtual bool error(const string& message, const std::string& what) const override; virtual bool missing_command(const string& message, const string& what, - const string& command, uint64_t used_features) const override; + const string& command, uf_t used_features) const override; virtual bool ambiguity_partition_table_and_filesystem(const string& message, const string& what, const string& name, PtType pt_type, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/probe/disk-devicegraph.xml new/libstorage-ng-4.5.48/testsuite/probe/disk-devicegraph.xml --- old/libstorage-ng-4.5.47/testsuite/probe/disk-devicegraph.xml 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/testsuite/probe/disk-devicegraph.xml 2022-10-28 12:32:37.000000000 +0200 @@ -115,7 +115,7 @@ <path>/</path> <mount-by>uuid</mount-by> <mount-type>ext4</mount-type> - <mount-options>acl,user_xattr</mount-options> + <mount-options>usrquota,grpquota</mount-options> <in-etc-fstab>true</in-etc-fstab> <freq>0</freq> <passno>0</passno> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/probe/disk-mockup.xml new/libstorage-ng-4.5.48/testsuite/probe/disk-mockup.xml --- old/libstorage-ng-4.5.47/testsuite/probe/disk-mockup.xml 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/testsuite/probe/disk-mockup.xml 2022-10-28 12:32:37.000000000 +0200 @@ -440,7 +440,7 @@ <File> <name>/etc/fstab</name> <content>UUID=86b64dbc-0530-4a4b-bca7-72e2c8b4e317 swap swap defaults 0 0</content> - <content>UUID=9f0f12c5-4d18-494b-b234-7342c953e99a / ext4 acl,user_xattr 1 1</content> + <content>UUID=9f0f12c5-4d18-494b-b234-7342c953e99a / ext4 usrquota,grpquota 1 1</content> <content>LABEL=HOME /home ext4 defaults 0 0</content> </File> <File> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/probe/disk.cc new/libstorage-ng-4.5.48/testsuite/probe/disk.cc --- old/libstorage-ng-4.5.47/testsuite/probe/disk.cc 2022-10-18 15:28:26.000000000 +0200 +++ new/libstorage-ng-4.5.48/testsuite/probe/disk.cc 2022-10-28 12:32:37.000000000 +0200 @@ -36,8 +36,8 @@ TsCmpDevicegraph cmp(*probed, *staging); BOOST_CHECK_MESSAGE(cmp.ok(), cmp); - BOOST_CHECK_EQUAL(required_features(probed), "ext4 swap"); - BOOST_CHECK_EQUAL(suggested_features(probed), "ext4 swap"); + BOOST_CHECK_EQUAL(required_features(probed), "ext4 quota swap"); + BOOST_CHECK_EQUAL(suggested_features(probed), "ext4 quota swap"); BOOST_CHECK_EQUAL(pools(&storage), "HDDs (512 B) [1], SSDs (512 B) [1]"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/used-features/.gitignore new/libstorage-ng-4.5.48/testsuite/used-features/.gitignore --- old/libstorage-ng-4.5.47/testsuite/used-features/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.5.48/testsuite/used-features/.gitignore 2022-10-28 12:32:37.000000000 +0200 @@ -0,0 +1,7 @@ +*.log +*.o +*.test +*.trs +.deps +.libs +test-suite.log diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/used-features/Makefile.am new/libstorage-ng-4.5.48/testsuite/used-features/Makefile.am --- old/libstorage-ng-4.5.47/testsuite/used-features/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.5.48/testsuite/used-features/Makefile.am 2022-10-28 12:32:37.000000000 +0200 @@ -0,0 +1,16 @@ +# +# Makefile.am for libstorage/testsuite/used-features +# + +AM_CPPFLAGS = -I$(top_srcdir) + +LDADD = ../../storage/libstorage-ng.la ../helpers/libhelpers.la \ + -lboost_unit_test_framework + +check_PROGRAMS = \ + quota.test + +AM_DEFAULT_SOURCE_EXT = .cc + +TESTS = $(check_PROGRAMS) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.47/testsuite/used-features/quota.cc new/libstorage-ng-4.5.48/testsuite/used-features/quota.cc --- old/libstorage-ng-4.5.47/testsuite/used-features/quota.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-4.5.48/testsuite/used-features/quota.cc 2022-10-28 12:32:37.000000000 +0200 @@ -0,0 +1,126 @@ + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE libstorage + +#include <boost/test/unit_test.hpp> + +#include "storage/Utils/HumanString.h" +#include "storage/Devices/Disk.h" +#include "storage/Devices/Gpt.h" +#include "storage/Filesystems/Ext4.h" +#include "storage/Filesystems/Xfs.h" +#include "storage/Filesystems/MountPoint.h" +#include "storage/Devicegraph.h" +#include "storage/Storage.h" +#include "storage/Environment.h" + +#include "testsuite/helpers/TsCmp.h" + + +using namespace std; +using namespace storage; + + +BOOST_AUTO_TEST_CASE(ext4) +{ + Environment environment(true, ProbeMode::NONE, TargetMode::DIRECT); + + Storage storage(environment); + + Devicegraph* staging = storage.get_staging(); + + Disk* sda = Disk::create(staging, "/dev/sda"); + sda->set_size(1 * TiB); + + Gpt* gpt = to_gpt(sda->create_partition_table(PtType::GPT)); + + Partition* sda1 = gpt->create_partition("/dev/sda1", Region(2048, 1000000, 512), PartitionType::PRIMARY); + + Ext4* ext4 = to_ext4(sda1->create_blk_filesystem(FsType::EXT4)); + + MountPoint* mount_point = ext4->create_mount_point("/test"); + + { + mount_point->set_mount_options({ }); + + BOOST_CHECK_EQUAL(required_features(staging), "ext4"); + BOOST_CHECK_EQUAL(suggested_features(staging), "ext4"); + } + + { + mount_point->set_mount_options({ "quota", "data=ordered" }); + + BOOST_CHECK_EQUAL(required_features(staging), "ext4 quota"); + BOOST_CHECK_EQUAL(suggested_features(staging), "ext4 quota"); + } + + { + mount_point->set_mount_options({ "noquota" }); + + BOOST_CHECK_EQUAL(required_features(staging), "ext4"); + BOOST_CHECK_EQUAL(suggested_features(staging), "ext4"); + } + + { + mount_point->set_mount_options({ "prjquota" }); + + BOOST_CHECK_EQUAL(required_features(staging), "ext4 quota"); + BOOST_CHECK_EQUAL(suggested_features(staging), "ext4 quota"); + } + + { + mount_point->set_mount_options({ "usrjquota=aquota.user" }); + + BOOST_CHECK_EQUAL(required_features(staging), "ext4 quota"); + BOOST_CHECK_EQUAL(suggested_features(staging), "ext4 quota"); + } +} + + +BOOST_AUTO_TEST_CASE(xfs) +{ + Environment environment(true, ProbeMode::NONE, TargetMode::DIRECT); + + Storage storage(environment); + + Devicegraph* staging = storage.get_staging(); + + Disk* sda = Disk::create(staging, "/dev/sda"); + sda->set_size(1 * TiB); + + Gpt* gpt = to_gpt(sda->create_partition_table(PtType::GPT)); + + Partition* sda1 = gpt->create_partition("/dev/sda1", Region(2048, 1000000, 512), PartitionType::PRIMARY); + + Xfs* xfs = to_xfs(sda1->create_blk_filesystem(FsType::XFS)); + + MountPoint* mount_point = xfs->create_mount_point("/test"); + + { + mount_point->set_mount_options({ }); + + BOOST_CHECK_EQUAL(required_features(staging), "xfs"); + BOOST_CHECK_EQUAL(suggested_features(staging), "xfs"); + } + + { + mount_point->set_mount_options({ "quota" }); + + BOOST_CHECK_EQUAL(required_features(staging), "quota xfs"); + BOOST_CHECK_EQUAL(suggested_features(staging), "quota xfs"); + } + + { + mount_point->set_mount_options({ "noquota" }); + + BOOST_CHECK_EQUAL(required_features(staging), "xfs"); + BOOST_CHECK_EQUAL(suggested_features(staging), "xfs"); + } + + { + mount_point->set_mount_options({ "pquota" }); + + BOOST_CHECK_EQUAL(required_features(staging), "quota xfs"); + BOOST_CHECK_EQUAL(suggested_features(staging), "quota xfs"); + } +}