** Description changed:

  [Impact]
  This is a major rewrite of ubuntu-advantage-client. This version introduces 
an updated command line interface (UA Client) to simplify some interaction with 
Ubuntu Advantage support offerings, and interacts with a new service backend 
built specifically for this new streamlined experience.
  
  Disco, Eoan, and Focal already have this rewrite (but an older version
  of it), but trusty, xenial, bionic and cosmic do not. This update is for
  trusty only at the moment, because the other LTSs and later releases
  have other services available under the UA umbrella which haven't yet
  been fully converted to the new backend.
  
  [Test Case]
  There are free services available for Trusty and anyone with an ubuntu one 
account can try them out with the new client.
  
  In order to attach a machine to UA, first obtain a token at
  https://auth.contracts.canonical.com/. With that token, attach the
  machine with this command:
  
  sudo ua attach <token>
  
  If that's successful, you will have ESM-infra enabled at the end.
  
  Additional test cases to confirm that the package correctly handles
  upgrades for all relevant cases:
  
- 2. Trusty -proposed upgrade tests
+ 
+ 2. Trusty -proposed upgrade tests (TODO: run test-2a.sh and attach logs)
  #  2a. Start with a fresh Ubuntu instance which does not have u-a-t installed 
(i.e. ubuntu-minimal is not installed).  Install u-a-t from -updates. Do not 
enable ua. Upgrade to u-a-t from -proposed.
  
  echo --- BEGIN test 2a: upgrade unattached trusty-updates -> trusty-proposed
  # Make a minimal trusty chroot
  mk-sbuild trusty
+ # Add the following placeholder for bind mounts in your 
/etc/schroot/sbuild/fstab:
+ 
+ # SRUDATADIR
+ 
+ # Add a shared data directory into the chroot/fstab
+ mkdir -b 2a/var/lib/
+ sudo sed -i 's/.*SRUDATADIR/\/home\/csmith\/2a     \/data   none    rw,bind   
      0       0  # SRUDATADIR" /etc/schroot/sbuild/fstab
  
  # connect to chroot and install on a system that lacks ubuntu-advantage-tools
- schroot -u root -c trusty-amd64 --directory /
- 
- echo "test: No ubuntu-minimal or ubuntu-advantage-tools found"
- dpkg -l | egrep 'ubuntu-advantage|ubuntu-minimal'
- 
+ CHROOT_DIR=`schroot --config  -c trusty-amd64  | awk -F "=" 
'/^directory=/{print $2}'`
  
  # Install ua-tools from a given pocket name
  cat > ua_tools_install_from_pocket.sh  <<EOF
  #/bin/bash
  pocket_name=\$1
  mirror=http://archive.ubuntu.com/ubuntu
  echo deb \$mirror \$pocket_name main | tee 
/etc/apt/sources.list.d/\$pocket_name.list
  apt-get update -q;
  apt-get install -qy ubuntu-advantage-tools;
  echo \$?
- dpkg-query --show ubuntu-advantage-tools
  EOF
- # Install ua-tools from trusty-updates
- bash ua_tools_install_from_pocket.sh trusty-updates
+ sudo cp ua_tools_install_from_pocket.sh $CHROOT_DIR
  
- # Install ua-tools from trusty-proposed
- bash ua_tools_install_from_pocket.sh trusty-proposed
- 
- echo "--- begin dpkg -l ----"
- dpkg -l > 2a-ua-files.list
- echo "--- end dpkg -l ----"
- echo "--- begin find /etc ----"
- find /etc >> 2a-ua-files.list
- echo "--- end find /etc ----"
- echo "--- begin find /var/lib/ubuntu-advantage ----"
- find /var/lib/ubuntu-advantage >> 2a-ua-files.list
- echo "--- end find /var/lib/ubuntu-advantage ----"
- 
- 
- # 2b. In an identical instance, install u-a-t from -proposed.
- echo --- BEGIN test 2b: install clean unattached trusty-proposed
- # connect to chroot and install on a system that lacks ubuntu-advantage-tools
  schroot -u root -c trusty-amd64 --directory /
  
  echo "test: No ubuntu-minimal or ubuntu-advantage-tools found"
  dpkg -l | egrep 'ubuntu-advantage|ubuntu-minimal'
  
+ # Install ua-tools from trusty-updates
+ bash /ua_tools_install_from_pocket.sh trusty-updates
  
- # Install ua-tools from a given pocket name
- cat > ua_tools_install_from_pocket.sh  <<EOF
- #/bin/bash
- pocket_name=\$1
- mirror=http://archive.ubuntu.com/ubuntu
- echo deb \$mirror \$pocket_name main | tee 
/etc/apt/sources.list.d/\$pocket_name.list
- apt-get update -q;
- apt-get install -qy ubuntu-advantage-tools;
- echo \$?
- dpkg-query --show ubuntu-advantage-tools
- EOF
  # Install ua-tools from trusty-proposed
- bash ua_tools_install_from_pocket.sh trusty-proposed
- echo "--- begin dpkg -l ----"
- dpkg -l > 2b-ua-files.list
- echo "--- end dpkg -l ----"
- echo "--- begin find /etc ----"
- find /etc >> 2b-ua-files.list
- echo "--- end find /etc ----"
- echo "--- begin find /var/lib/ubuntu-advantage ----"
- find /var/lib/ubuntu-advantage >> 2b-ua-files.list
- echo "--- end find /var/lib/ubuntu-advantage ----"
+ bash /ua_tools_install_from_pocket.sh trusty-proposed
+ 
+ dpkg -l > /data/dpkg.list
+ cp -r /etc/ /data
+ cp -r /var/lib/ubuntu-advantage/* /data/var/lib/ubuntu-advantage
+ exit
+ 
+ 
+ # 2b. In an identical instance, install u-a-t directly from -proposed.
+ echo --- BEGIN test 2b: install clean unattached trusty-proposed
+ # connect to chroot and install on a system that lacks ubuntu-advantage-tools
+ schroot -u root -c trusty-amd64 --directory /
+ 
+ # Add a shared data directory into the chroot/fstab
+ mkdir -b 2a/var/lib/
+ sudo sed -i 's/.*SRUDATADIR/\/home\/csmith\/2a     \/data   none    rw,bind   
      0       0  # SRUDATADIR" /etc/schroot/sbuild/fstab
+ 
+ # connect to chroot and install on a system that lacks ubuntu-advantage-
+ tools
+ 
+ schroot -u root -c trusty-amd64 --directory /
+ 
+ echo "test: No ubuntu-minimal or ubuntu-advantage-tools found"
+ dpkg -l | egrep 'ubuntu-advantage|ubuntu-minimal'
+ 
+ # Install ua-tools from trusty-proposed
+ bash /ua_tools_install_from_pocket.sh trusty-proposed
+ 
+ dpkg -l > /data/dpkg.list
+ cp -r /etc/ /data
+ cp -r /var/lib/ubuntu-advantage/* /data/var/lib/ubuntu-advantage
+ exit
+ 
  
  # 2c. Confirm that the on-disk results of a) and b) are identical.
- 
- diff -urN 2a-ua-files.list 2b-ua-files.list
- 
+ echo --- BEGIN test 2c: ensure no filesystem diffs betwenn 2a and 2b
+ diff -urN 2a 2b
  
  
  3.
   a. Start with a fresh Ubuntu instance which does not have u-a-t installed 
(i.e. ubuntu-minimal is not installed).  Install u-a-t from -updates. Enable 
esm with 'ubuntu-advantage enable-esm'.  Upgrade to u-a-t from -proposed.
   b. In an identical instance, install u-a-t from -proposed.  Enable esm with 
'ubuntu-advantage attach'.
   c. Confirm that the on-disk results of a) and b) are identical.
  4.
   a. Start with a fresh Ubuntu instance which does have u-a-t installed.  
Enable esm with 'ubuntu-advantage enable-esm'.  Upgrade to u-a-t from -proposed.
   b. In an identical instance, upgrade to u-a-t from -proposed.  Enable esm 
with 'ubuntu-advantage attach'.
   c. Confirm that the on-disk results of a) and b) are identical.
  5.
   a. Start with a fresh Ubuntu *precise* instance which does have u-a-t 
installed and esm enabled.  Dist-upgrade to trusty, then upgrade to u-a-t from 
-proposed.
   b. In an identical instance, dist-upgrade to trusty with -proposed enabled.
   c. Confirm that the on-disk results of a) and b) are identical.
  
  [Regression Potential]
  This is a major rewrite from bash to python3 and there are changes in 
behavior.
  - new services will be listed, but not avaialble for trusty, only for later 
LTSs
  - even when ESM is not enabled, an apt hook will advertise the availability 
of updates in that repository. This hook has failed in the past while this 
package was in disco, and that failed the apt transaction. This has of course 
been fixed since then (see #1824523 and #1824523).
  
  [Other Info]
  This is the FFe bug that got this rewrite into Disco at that time:
  https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1814157
  
  Development of this client is happening on github:
  https://github.com/CanonicalLtd/ubuntu-advantage-client
  
  Recently esm was renamed to esm-infra. Upgrading from an older package
  where it was just "esm" is handled in postinst.
  
  The ESM-infra GPG key can be verified by checking the signed release
  file over https:
  
  ESM: https://esm.ubuntu.com/ubuntu/dists/trusty-infra-updates/InRelease
  and https://esm.ubuntu.com/ubuntu/dists/trusty-infra-security/InRelease
  
  On an upgrade, existing users of trusty esm are expected to run "sudo ua
  attach [<token>]", although not doing it won't disable their existing
  ESM access. The new ua tool just won't recognize esm as being active in
  its "ua status" output until the attach operation is complete. The same
  applies to livepatch, if it was enabled before.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1832757

Title:
  Update ubuntu-advantage-client

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1832757/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to