2013-08-14 17:05:09 +04:00
#!/bin/bash
#
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
2018-01-30 22:26:26 +03:00
# SPDX-License-Identifier: LGPL-2.0+
#
2013-08-14 17:05:09 +04:00
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
2016-01-27 19:44:10 +03:00
set -euo pipefail
2013-08-14 17:05:09 +04:00
2016-03-31 19:47:36 +03:00
. $( dirname $0 ) /libtest.sh
2013-08-14 22:46:46 +04:00
2017-03-24 17:35:59 +03:00
skip "We don't really have a use case for committing user. xattrs right now. See also https://github.com/ostreedev/ostree/issues/758"
# Dead code below
2016-03-31 19:47:36 +03:00
skip_without_user_xattrs
2013-08-14 17:05:09 +04:00
2016-03-31 19:47:36 +03:00
echo "1..2"
2013-08-14 17:05:09 +04:00
2017-09-01 23:15:33 +03:00
setup_test_repository "archive"
2013-08-14 17:05:09 +04:00
cd ${ test_tmpdir }
2015-11-09 15:03:35 +03:00
${ CMD_PREFIX } ostree --repo= repo checkout test2 test2-checkout1
2013-08-14 17:05:09 +04:00
setfattr -n user.ostree-test -v testvalue test2-checkout1/firstfile
setfattr -n user.test0 -v moo test2-checkout1/firstfile
2015-11-09 15:03:35 +03:00
${ CMD_PREFIX } ostree --repo= repo commit -b test2 -s xattrs --tree= dir = test2-checkout1
2013-08-14 17:05:09 +04:00
rm test2-checkout1 -rf
echo "ok commit with xattrs"
2015-11-09 15:03:35 +03:00
${ CMD_PREFIX } ostree --repo= repo checkout test2 test2-checkout2
2013-08-14 17:05:09 +04:00
getfattr -m . test2-checkout2/firstfile > attrs
assert_file_has_content attrs '^user.ostree-test'
assert_file_has_content attrs '^user.test0'
getfattr -n user.ostree-test --only-values test2-checkout2/firstfile > v0
assert_file_has_content v0 '^testvalue$'
getfattr -n user.test0 --only-values test2-checkout2/firstfile > v1
assert_file_has_content v1 '^moo$'
echo "ok checkout with xattrs"