2013-08-14 17:05:09 +04:00
#!/bin/bash
#
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
# 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
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
setup_test_repository "archive-z2"
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"