User Tools

Site Tools


services:labtest:laptop

This is an old revision of the document!


Labtest Mode (Laptop Edition)

Laptop Labtest brings some of the functionality of desktop labtest to tech-managed laptops in our labs. Laptop labtest provides a secure computing environment where students have access to the software on our laptops, without having access to their files, the Internet, printing, or email. Students view the test question from a secure web server. They submit their work using a web-based submit tool.

Requesting Laptop Labtest

In order to place laptops into labtest mode, faculty must provide various information to tech.

View the current lab booking schedule here.

Please contact tech as soon as possible to schedule your labtest sessions or if there is a discrepancy in your scheduled test.

Setting Up Your Labtest

Create a “labtest” directory inside your course web directory:

% mkdir /eecs/dept/www/course/9999/labtest

Make it owned by “labtest” group:

% chgrp labtest /eecs/dept/www/course/9999/labtest

Makes sure nobody can access your labtest folder while you work on preparing it:

% chmod 700 /eecs/dept/www/course/9999/labtest

Place files in your labtest folder which will be viewable by students in labtest mode. You can use HTML, CGI, PHP, and more.

Authentication in Labtest

Students will only be able to view your labtest web page from a laptop that is in labtest mode. However, by default, students will not need to authenticate to view the page. You may wish to require students to authenticate via Passport York or EECS login as follows:

Passport York Authentication

In order to authenticate students via Passport York login, Create a .htaccess file in the labtest web directory containing:

AuthType Basic
AuthName "EECS Laptop Labtest" <- can be whatever you like
AuthType PYork
Require valid-user
PYorkAllowEveryone on
PYorkAppID "eecs-labtest"
Require valid-user

Make sure the file is readable:

% chmod 644 /eecs/dept/www/course/9999/labtest/.htaccess

The Passport York module passes additional variables which can be used by custom scripts including:

  • HTTP_PYORK_VERSION - PassportYork version
  • HTTP_PYORK_USER - PassportYork username
  • HTTP_PYORK_SESSION_ID - PassportYork session ID
  • HTTP_PYORK_CYIN - student number/employee number
  • HTTP_PYORK_FIRSTNAME - first name
  • HTTP_PYORK_SURNAME - surname
  • HTTP_PYORK_EMAIL - email

NOTE: If you authenticate students via their Passport York account, when they go to submit using web submit, they won't have to login again!

EECS Authentication

In order to authenticate students via EECS login, Create a .htaccess file in the labtest web directory containing:

AuthType Basic
AuthName "Authorization Required"
AuthBasicProvider external
AuthExternal eecs
Require valid-user

WARNING: Students will only be able to view your labtest page via the web when they are on a laptop that is in labtest mode. However, if you don't secure the permission on the labtest web folder, students who have access to EECS infrastructure will still be able to view your page by visiting /eecs/dept/www/course/XXXX/labtest directly.

Securing Your Labtest

To make your labtest available, run “ltenable”:

% ltenable /eecs/dept/www/course/9999/labtest

To disable your labtest, run “ltdisable”:

% ltdisable /eecs/dept/www/course/9999/labtest

Setting Up A Submit Directory

Create a submit directory in your course directory:

% mkdir /eecs/dept/course/9999/submit

This directory should be available to anyone:

% chmod 755 /eecs/dept/course/9999/submit

Create a directory to accept permissions for your lab:

% mkdir /eecs/dept/course/9999/submit/lab1

The submission directory must be group labtest:

% chgrp labtest /eecs/dept/course/9999/submit/lab1

To enable submissions on the day of your test:

% chmod 770 /eecs/dept/course/9999/submit/lab1

To disable submissions after your test is done:

% chmod 700 /eecs/dept/course/9999/submit/lab1

For additional information on submit including options to enable/disable previews, logging, and custom IP address limits, please refer to this page.

Allowing Access to Previously Submitted Data In A Labtest

From time to time, you may wish to allow students in labtest mode to access previously submitted content from outside labtest mode. In order to make this happen, all you need to do is change the group of the submit assignment directory from submit (non-labtest mode) to labtest, and remove write permission. Now, during your labtest, students will be able to view the contents of their previous submission.

For example:

% chgrp -R labtest /eecs/course/9999/submit/A
% chmod 750 /eecs/course/9999/submit/A

Labtest Account Customization

Sometimes, your labtest may require students to download and unarchive files, or run a set of commands prior to your test. This introduces avenues for trouble if the students don't follow your instructions properly. Laptop labtest allows you to provide a folder of files that will be copied down to the laptop. In addition, it allows you to specify a shell script that can run on the laptop to process the files (eg. unzip an archive into the right folder), or to run additional commands.

Create a folder for labtest initialization in your course web folder:

% mkdir /eecs/dept/www/course/9999/labtest/ltinit

Copy files into this folder. Your files must be readable by group labtest.

Create a custom shell script called “labtest.sh” in this folder. This file will be downloaded by the laptop, and executed on the account.

You must include a .htaccess file in the ltinit folder as follows:

% echo "Require all granted" > /eecs/dept/www/course/9999/labtest/ltinit/.htaccess
% chmod 644 /eecs/dept/www/course/9999/labtest/ltinit/.htaccess

Testing Your Labtest Setup

For information on testing your labtest setup, please see here.

On The Day of Your Labtest

At the time of your labtest, a system process will enable te laptops that you've booked to go into labtest mode. Unlike desktop labtest mode, the laptops will not go into labtest mode automatically. Instead, you or your TA will need to manually boot the laptops. As part of securing the laptop into labtest mode, in the middle of the boot sequence, the laptop will reboot again. After booting, it will display a message: “Labtest mode is now active”. Only then can you be assured that the machine is in labtest mode. At this time, there is no other indication that a laptop is in labtest mode. In between tests, the machines will also need to be rebooted to return them to a clear state.

Since EECS laptops don't mount /eecs from our file server, the student laptop does not have direct access to /eecs/dept/www to display the labtest question. As a result, a web server, labtest.eecs.yorku.ca serves your labtest page to the student.

Students should start the eecs-vbox-common-lab virtual machine, and then start Firefox to get the test question. The labtest start page will be displayed - https://labtest.eecs.yorku.ca where the student can read a standard Labtest disclaimer, then click on a “Start Lab Test” link which directs the student to the content from your labtest. This link will look like: https://labtest.eecs.yorku.ca/host/<hostname>. A student on one laptop can't view the host link from a different laptop. When the student is directed to your test, they will be prompted for authentication if you've enabled that feature. If you try to view the labtest web page from a machine that is not in labtest mode, an error will be displayed: “Please visit this site when your computer is in labtest mode.”.

In order to submit files, the student should visit: https://labtest.eecs.yorku.ca/submit Please make sure that your submit folder is writable by group labtest, or students will be unable to submit.

During labtest mode, the laptops networking is severely restricted. Access to any web resources will be redirected back to the labtest start page.

At the end of your labtest, a system process will disable the laptops from entering labtest mode, but you or your TA must reboot the laptops connected to the wired network in order to make the laptop go back to labtest mode. If a laptop is returned to the lab monitor without being set back to linux mode, then a student will not be able to use that laptop again until it is connected to the wired network, and booted one time.

Application Notes

This section will include notes on user experiences using different applications in labtest mode.

  • Android Studio was not happy about working in offline/labtest mode. However, Android Studio does have an “offline” mode. To enable it, you have to start Android Studio, choose “configure”, then settings, then search for “gradle” (or go to “Build, Execution, Deployment” and choose “Build Tools”, then “gradle”). Then check off “Offline work”. You have to create a new project, and built it one time. You then have to capture the complete .AndroidStudio2.1, .gradle, and AndroidStudioProjects/<project> directory, and give that to the students during the test. If they write a main method or use junit, Android Studio does not build it and hence they cannot test their code. You may want to include a simple test (main method of junit) and build the project before creating the archive.

Other Information

  • At this time, laptop labtest requires the laptop to be connected to a wired network drop on a VLAN managed by EECS. It does not work over WiFi. As a result, laptop labtest is not usable in the alternate exam centre.
  • Students must save and submit files frequently throughout the test to avoid loss in the event of machine failure or human error. Should a machine lock up during the test, and the machine needs to be rebooted, the student will lose their files.
  • At the end of the test, close the permission on the submit directory so that it is no longer readable and writable by group labtest.
  • If a student visits the labtest start page from the host O/S, and not the VM, then, when they go to submit their files, they won't see any of the files that they've worked on. Instead, they'll see the empty home directory from the host O/S.

Since pcmode does not communicate with machines, it will not reboot them at the end of the test or inform that the test is coming to a close. However, you can inform the students verbally, and close the submit directory.

  • Items in regular labtest that do NOT appear in laptop labtest: automatic rebooting of laptops, automatic warnings at the end of the test, SecureQ (it's available, but is impossible if the laptops are laid out randomly), and labtest file synchronization
services/labtest/laptop.1500041482.txt.gz · Last modified: 2017/07/14 10:11 by jas