-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: make user-config world readable #2804
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
series=$1 | ||
install_from=$2 # either path to a .deb, or 'staging', or 'proposed' | ||
|
||
name=$series-dev | ||
|
||
function cleanup { | ||
lxc delete $name --force | ||
} | ||
|
||
function on_err { | ||
echo -e "Test Failed" | ||
cleanup | ||
exit 1 | ||
} | ||
trap on_err ERR | ||
|
||
|
||
lxc launch ubuntu-daily:$series $name | ||
sleep 5 | ||
|
||
# Install latest ubuntu-advantage-tools | ||
lxc exec $name -- apt-get update > /dev/null | ||
lxc exec $name -- apt-get install -y ubuntu-advantage-tools > /dev/null | ||
echo -e "\n* Latest u-a-t is installed" | ||
echo "###########################################" | ||
lxc exec $name -- apt-cache policy ubuntu-advantage-tools | ||
echo -e "###########################################\n" | ||
|
||
echo -e "\n* Modify metering job" | ||
echo "###########################################" | ||
lxc exec $name -- pro config set metering_timer=2000 | ||
lxc exec $name -- pro config show | ||
echo -e "###########################################\n" | ||
|
||
echo -e "\n* Show that non-root user cannot see the modification" | ||
echo "###########################################" | ||
lxc exec --user 1000 $name -- pro config show | ||
echo -e "###########################################\n" | ||
|
||
|
||
# Upgrade u-a-t to new version | ||
# ---------------------------------------------------------------- | ||
if [ $install_from == 'staging' ]; then | ||
lxc exec $name -- sudo add-apt-repository ppa:ua-client/staging -y > /dev/null | ||
lxc exec $name -- apt-get update > /dev/null | ||
lxc exec $name -- apt-get install ubuntu-advantage-tools -y > /dev/null | ||
elif [ $install_from == 'proposed' ]; then | ||
lxc exec $name -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list" | ||
lxc exec $name -- apt-get update > /dev/null | ||
lxc exec $name -- apt-get install ubuntu-advantage-tools -y > /dev/null | ||
else | ||
lxc file push $install_from $name/new-ua.deb | ||
lxc exec $name -- dpkg -i /new-ua.deb > /dev/null | ||
fi | ||
# ---------------------------------------------------------------- | ||
|
||
echo -e "\n* Show that non-root user now can see the modification" | ||
echo "###########################################" | ||
lxc exec --user 1000 $name -- pro config show | ||
echo -e "###########################################\n" | ||
|
||
echo -e "\n* notice that user-config is now world-readable" | ||
echo "###########################################" | ||
lxc exec $name -- ls -la /var/lib/ubuntu-advantage/user-config.json | ||
echo -e "###########################################\n" | ||
|
||
cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to continue the pattern of keeping the version migrations in order, so can you move this down after the
if dpkg --compare-versions "$PREVIOUS_PKG_VER" lt "29~";
block?