mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
e8d62b64d5
fbshipit-source-id: 43a0252cb3ec42aa365f20d1b6faa4d24d74c9b8
66 lines
1.7 KiB
Raku
66 lines
1.7 KiB
Raku
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This software may be used and distributed according to the terms of the
|
|
# GNU General Public License found in the LICENSE file in the root
|
|
# directory of this source tree.
|
|
|
|
$ . "${TEST_FIXTURES}/library.sh"
|
|
|
|
# Create a repository
|
|
$ setup_mononoke_config
|
|
$ REPOID=1 FILESTORE=1 FILESTORE_CHUNK_SIZE=10 setup_mononoke_repo_config repo1
|
|
$ LIVE_CONFIG="${TESTTMP}/live.json"
|
|
$ cat > "$LIVE_CONFIG" << EOF
|
|
> {
|
|
> "track_bytes_sent": true,
|
|
> "enable_consistent_routing": false,
|
|
> "disable_hostname_logging": false,
|
|
> "throttle_limits": [],
|
|
> "acl_check": false,
|
|
> "enforce_acl_check": false
|
|
> }
|
|
> EOF
|
|
|
|
# Start an LFS server
|
|
$ lfs_log="$TESTTMP/lfs.log"
|
|
$ lfs_root="$(lfs_server --log "$lfs_log" --live-config "file:${LIVE_CONFIG}")"
|
|
|
|
# Get the config
|
|
$ curl -fs "${lfs_root}/config" | jq -S .
|
|
{
|
|
"acl_check": false,
|
|
"disable_hostname_logging": false,
|
|
"enable_consistent_routing": false,
|
|
"enforce_acl_check": false,
|
|
"throttle_limits": [],
|
|
"track_bytes_sent": true
|
|
}
|
|
|
|
# Update the config
|
|
$ cat > "$LIVE_CONFIG" << EOF
|
|
> {
|
|
> "track_bytes_sent": false,
|
|
> "enable_consistent_routing": false,
|
|
> "disable_hostname_logging": false,
|
|
> "throttle_limits": [],
|
|
> "acl_check": false,
|
|
> "enforce_acl_check": false
|
|
> }
|
|
> EOF
|
|
|
|
# Wait for it to be updated
|
|
$ sleep 2
|
|
$ grep "$LIVE_CONFIG" "$lfs_log"
|
|
* Updated path $TESTTMP/live.json (glob)
|
|
|
|
# Get the updated config
|
|
$ curl -fs "${lfs_root}/config" | jq -S .
|
|
{
|
|
"acl_check": false,
|
|
"disable_hostname_logging": false,
|
|
"enable_consistent_routing": false,
|
|
"enforce_acl_check": false,
|
|
"throttle_limits": [],
|
|
"track_bytes_sent": false
|
|
}
|