[ This is twiki markup, for easy pasting. ]

---+++ About the test repository

The test repository contains four distributions: =cert=, =old=, =new=,
and =demo=.  The =cert= distribution is intended to be configured as a
certified source.  The two distributions =old= and =new= contain
mostly the same packages, but =new= might contain newer versions of
some of the packages in =old=, for example.  The =demo= distribution
is used with the `Single-Click-Install' feature.

When configured by installing =testrepo-conf-mmc= (see previous
section), the =cert= distribution is configured as 'certified' and
'essential'.  The =old= distribution is enabled and the =new= one is
disabled.  You can switch to =new= by disabling =old= and enabling
=new=, obviously.  You can have both =old= and =new= enabled at the
same time, but that is not a very useful thing to do.  Neither =old=
nor =new= are certified or essential.

The packages and the distributions they are in:

   * *certified 1* (cert)
     <p>
     The only package in the =cert= distribution.  Installing it
     should not show the disclaimer dialog.

   * *package-A 1* (old), *package-A 2* (new)
     <p>
     Standalone package that depends on nothing and conflicts with
     nothing.  You can use it to test basic installation, upgrading and
     uninstallation.
     <p>
     To test upgrading, first install version 1 from =old=, then switch
     to =new=.  Package-A version 2 should be listed in the "Check for
     updates" view.

   * *package-B 1* (old), *package-B 2* (new)
     <p>
     Conflicts with package-A 1 (but no other version of package-A).
     You can use it together with package-A to test the behavior when
     conflicts are present.  It must not be possible to install
     package-A version 1 and package B at the same time.  You can
     install package-A version 2 and package-B at the same time,
     however.
     <p>
     Version 2 of package-B also depends on the "missing" package,
     which is not available.

   * *package-C 1* (old), *package-C 2.cr* (new)
     <p>
     Depends on package-B, any version.  You can use it to test
     dependencies between packages, and indirect conflicts.
     <p>
     When package-A version 1 and package-B are not installed,
     installing package-C should automatically install package-B as
     well.
     <p>
     When package-A version 1 is installed (and consequently, package-B
     is not installed), installing package-C should not be possible,
     listing package-A as the reason.
     <p>
     The file for package-C version 2.cr is corrupted and
     can not be installed.

   * *package-D 1* (old, new)
     <p>
     Depends on package "missing", which is not in the repository.

   * *package-1 0* (old, new)
     <p>
     A package with a real program in it.  Installing it will pop up
     the "Select Location Dialog" to let the user choose a location in
     the menu.

   * *package-2 0* (old, new)
     <p>
     A package with a real program in it and a checkrm script.  If you
     uninstall this package while the contained program is running,
     the uninstallation should be cancelled automatically.

   * *borken 1* (old, new)
     <p>
     A broken packages whose maintainer scripts will always fail.

   * *licensed 0* (old, new)
     <p>
     A package where the user needs to agree to a license before being
     allowed to use it.

   * *big 0* (old)
     <p>
     A package that contains one big, useless file.

   * *corrupted 1* (old, new)
     <p>
     A package whose archive file is corrupted.

   * *sized-5k 1*, *sized-50k 1*, *sized-500k 1*, *sized-5m 1*,
     *sized-50m 1*, *sized-500m 1*, *sized-1500m 1*, *sized-3g 1* (old)
     <p>
     Packages that claim to have the indicated Installed-Size.  They
     are actually empty and wont trigger any out of memory condition.
     You can use them to test the display of file sizes.

   * *user1 1*, *user2 1*, *system 1* (old, new)
     <p>
     The user1 and user2 packages both depend on the system package.
     User1 and user2 are 'user' packages (shown in the UI), while
     system is a 'non-user' package (not shown in the UI).

   * *stuck 1* (old, new)
     <p>
     This package takes one minute int its postinst script.

   * *notfound 1* (old, new)
     <p>
     This package is listed in the indices but the actual archive file
     has been deleted from the repository.

   * *docs 1* (old, new)
     <p>
     This package contains files in /usr/share/{doc,man,info} and can
     be used to test docpurge.

---+++ Standalone packages

The server with the test repository also contains a number of =.deb=
files that can be used to test the "Install from file" feature.
The files can be found in this location:

    http://stage.maemo.org/testrepo/

You can open them directly with the browser or copy them to your
device and open them with the File manager or via "Package / Install
from file."

These standalone =.deb= files are available:

   * *incompatible-arch_1_powerpc.deb*
   <p>
   This package is incompatible because it is for the "poerpc"
   architecture.

   * *incompatible-current_1_all.deb*
   <p>
   This package is incompatible because it depends on "maemo", which
   is a sign for packages that have been made for IT-2005.

   * *incompatible-system_1_all.deb*
   <p>
   This package is incompatible because it is not a user package.

   * *uncategorized_1_all.deb*
   <p>
   This packages has no "Section:" field.

   * *package-a_2_powerpc.deb*
   <p>
   Test package A, version two, for powerpc.

In addition you can use any other =.deb= file you find in the
=testrepo/= directory hierarchy.


---+++ Files for the "Single-Click-Install" feature

The server with the test repository also contains =.install= files.
These files contain instructions for the Application installer to add
repositories and/or install a package.  The files can be found on this
page:

    http://stage.maemo.org/testrepo/install.html

You can open them directly with the browser or copy them to your
device and open them with the File manager or via "Package / Install
from file."

These =.install= files are available:

   * *demo.install*
   <p>
   Installs the =demo= package from the =demo= distribution.

   * *demo-catalogue.install*
   <p>
   Adds the =demo= distribution to the list of configured sources.

   * *demo-old.install*
   <p>
   Installs the =demo= package from the =demo= distribution.  However,
   it doesn't declare itself to be compatible with maemo 3.0.


---+++ How to break packages to be half-installed

Some test cases below ask you to break a package in a specific way in
order to test whether the Application installer can fix them again.

These broken packages normally result from interrupted installations,
such as when the device reboots in the middle of an operation or when
you take out the MMC at the wrong time.

For testing the behavior of the Application installer, it is
sufficient to trick dpkg into thinking that the package is in a
intermediate state.  It is not necessary to actually interrupt the
installation.

A simple way to modify the state of a package is to edit
=/var/lib/dpkg/status=.  However that file is too big for the nimble
busybox vi.  Therefore, the following method is recommended.

   * Make sure the the Application installer is not running
   * Create a file with the status of the package by running =dpkg
   --status _package_ &gt;status.broken= (feel free to use a different filename
   from =status.broken=, of course).
   * Modify the =Status:= line in it to read
   <pre>
   Status: install reinstreq half-installed
   </pre>
   * Copy it to =/var/lib/dpkg/updates/0000=
   * Run =dpkg --configure -a= in a terminal.
   * Run =dpkg --status <packagename>= to verify the new status.

You can reuse the =status.broken= file when you run the test case again.

---+++ Sample test cases

Here are some test cases you can do with the packages in the test
repository.

---++++ Install, then update, then uninstall

   * Configure the =old= distribution.
   * Make sure that package-A is not installed.
   * Install package-A version 1 (from the "Games" section).
   * Configure the =new= distribution.
   * Update package-A to version 2 (via "Check for updates").
   * Uninstall package-A (via "List installed applications").

---++++ Install dependencies

   * Configure the =old= distribution.
   * Make sure none of package-A, package-B, and package-C are
     installed.
   * Open Details dialog for package-C.
   * Note that the "Installing" tab lists both package-B and package-C 
     to be installed.
   * Install package-C
   * Note that package-B has been installed as well.

---++++ Detect and resolve direct conflict

   * Configure the =old= distribution.
   * Make sure that package-B is not installed and that package-A
     version 1 is installed.
   * Try to install package-B.
   * Note that the installation will fail and that package-A is listed
     as the reason for it.
   * Uninstall package-A.
   * Install package-B, which should now succeed.

---++++ Detect and resolve indirect conflict

   * Configure the =old= distribution.
   * Make sure that package-C and package-B are not installed and that
     package-A version 1 is installed.
   * Try to install package-C.
   * Note that the installation will fail and that package-A is listed
     as the reason for it.
   * Uninstall package-A.
   * Install package-C, which should now succeed and automatically
     install package-B as well.

---++++ Detect and resolve direct conflict by updating

   * Configure the =old= distribution.
   * Make sure that package-B is not installed and that package-A
     version 1 is installed.
   * Try to install package-B.
   * Note that the installation will fail and that package-A is listed
     as the reason for it.
   * Configure the =new= distribution.
   * Install package-B, which should now succeed and automatically
     update package-A to version 2.

---++++ Refusal to uninstall needed package

   * Configure the =old= distribution.
   * Make sure that package-B and package-C are installed.
   * Try to uninstall package-B.
   * Note that the uninstallation will fail and list package-C as the
     reason for it.

---++++ Install Nokia certfied software

   * Install certified.
   * Note that the installation succeeds and does not show the
     legal disclaimer dialog.

---++++ Refusal to edit/remove essential repositories

   * Open the Tools/Repositories dialog.
   * Select the =cert= distribution.
   * Click again.
   * Note that the repository can not be edited.
   * Click on Remove.
   * Note that the repository is not removed.

---++++ Installing a package with a menu entry

   * Install package-1.
   * A dialog should be shown that let's you select a menu location.
   * Select a location and verify that the program "TestAppOne" is
     shown in that location.

---++++ Removing a package while its application is running

   * Make sure that package-2 is installed.
   * Start "test-app-two" from the menu and leave it running while
     performing the following steps.
   * Uninstall package-2 using the Application installer.
   * Note that the operation fails with an appropriate error message.
   * Switch to "test-app-two" and close it.
   * Uninstall package-2 using the Application installer.
   * Note that it now works.

---++++ Installing/removing a big package

   * Install the "big" package.
   * Note that the download dialog shows something like 5 Megabytes to
     be downloaded and that the progressbar works correctly.

---++++ Install a package with a license agreement

   * Install the "licensed" package.
   * Note that a license agreement is shown during installation.

---++++ Refusal to install a package with a missing dependency

   * Try to install the package-D.
   * Note that it can not be installed and that the details dialog
     lists "missing" being missing as the problem.

---++++ Failure to install a corrupted package

   * Try to install the "corrupted" package.
   * Note that this fails because the archive file is corrupted.

---++++ Automatic installation/removal of non-user packages

   * Make sure that =system= is not installed by running =dpkg --status system= in a terminal, for example.
   * Install =user1=
   * Verify that both =user1= and =system= are being installed.
   * Uninstall =user1=
   * Verify that both =user1= and =system= are being removed.

---++++ Automatic installation/removal of non-user packages (2)

   * Make sure that =system= is not installed by running =dpkg --status system= in a terminal, for example.
   * Install =user1=
   * Verify that both =user1= and =system= are being installed.
   * Install =user2=
   * Verify that =system= is not being installed
     (since it is already installed).
   * Uninstall =user1=
   * Verify that =system= is not being removed (since it is still
     needed by =user2=).
   * Uninstall =user2=
   * Verify that both =user2= and =system= are being removed.

---++++ Basic single-click-install

   * Make sure that the =demo= distribution is not listed in the
     Application Cataloque.  If it is there, remove it; disabling is
     not enough.
   * Make sure that the =demo= package is not installed.
   * Open =demo.install= with "Package / Install from file"
   * Notice that a new cataloque is getting added, that the list of
     packages is being refreshed and that =demo= is getting
     installed successfully
   
---++++ Single-click-install with existing repository

   * Make sure that the =demo= distribution is listed in the
     Application Cataloque and enabled.
   * Make sure that the =demo= package is not installed.
   * Open =demo.install= with "Package / Install from file"
   * Verify that =demo= is getting installed successfully.
   
---++++ Single-click-install with existing repository and package

   * Make sure that the =demo= distribution is listed in the
     Application Cataloque and enabled.
   * Make sure that osso-xterm is installed.
   * Open =osso-xterm.install= with "Package / Install from file"
   * Verify that osso-xterm is not getting installed with the
     information "Already latest version" (or similar).
   
---++++ Basic single-click-configure of new repository

   * Make sure that the =demo= distribution is not listed in the
     Application Cataloque.  If it is there, remove it; disabling is
     not enough.
   * Open =demo-cataloque.install= with "Package / Install from file"
   * Verify that a new cataloque is getting added and that the
     list of packages is being refreshed.

---++++ Single-click-configure of existing repository

   * Make sure that the =demo= distribution is listed in the
     Application Cataloque.
   * Open =demo-cataloque.install= with "Package / Install from file"
   * Verify that no new cataloque is getting added with the
     information "Already configured" (or similar).

---++++ Single-click-configure of incompatible distribution

   This test case needs osso-application-installer 4.34 or later.

   * Open =demo-old.install= with "Package / Install from file"
   * Notice that an error message about incompatible packages appears.

---++++ Updating to a corrupted package

   * Make sure that package-C version 1 is installed.
   * Configure the =new= distribution.
   * Try to update package-C to version 2.cr.
   * Notice that the update fails because the package
     is corrupted.

---++++ Updating with a missing dependency

   * Make sure that package-B version 1 is installed.
   * Configure the =new= distribution.
   * Try to update package-B to version 2.
   * Notice that the update fails because the package "missing" is
     missing.

---++++ Updating using a incompatible package

   * Make sure that package-A version 1 is installed
   * Install =package-a_2_powerpc.deb= using "Install from file ..."
   * Notice that the update fails because the packahe is incompatible

---++++ Directly fixing a broken, half-installed package

   * Make sure that package-A version 1 is installed and that
     the =old= distribution is configured.
   * Break package-A as explained above in "How to break packages to
     be half-installed".
   * Go to "Show installed applications" and verify that package-A has
     the status "Broken but updateable".
   * Go to "Check for updates" and verify that package-A is listed.
   * Update package-A and verify that it succeeds
   * Verify that package-A is now listed with status "Installed"

---++++ Indirectly fixing a broken, half-installed, non-user package

   * Make sure that the =old= distribution is configured and that the
     =user1= package is not installed.
   * Run =apt-get install system= in a terminal.
   * Break the =system= package as explained above in "How to break
     packages to be half-installed".
   * Open Application installer and install the =user1= package.
   * Verify that this suceeds.
   * Open the "Log" and verify that the =system= package has been
     downloaded and installed as well.
