Table of Contents

Labtest Mode

The purpose of this document is to provide an explanation of what labtest mode is, how to request it for your course, how to set it up, and how to check that it is setup correctly. If you have any questions about labtest, or if this documentation is unclear to you, please contact tech. Your feedback allows us to improve our documentation and make it easier for everyone to understand.

Introduction

Labtest mode provides a secure computing environment for in-lab testing. In labtest mode, students have access to either all or a limited of software on EECS systems and a course specific labtest web site. They lose access to all the files in their regular network-shared home directory, sending and receiving e-mail, printing, the external web (except as required), USB key/cdrom/floppy access, existing temporary files stored on the machine, and all access to the Internet including access to other EECS machines (except as required for services such as DNS, DHCP, etc.) and other York services like eClass (except where requested).

Faculty schedule labtests with the EECS tech team. A labtest reservation sometimes spans multiple computer labs depending on the number of students that will write the labtest at once. Faculty can schedule certain machines with extra time to accommodate students with alt exam requirements.

Prior to labtest time, faculty create a web page for their labtest. The page is only accessible to students on machines in labtest mode for that specific course. Faculty can use this site to post their questions (often a PDF or HTML), or to host files that the students need for their labtest (eg. data set). Faculty can update this page any time before or during the labtest. Using SecureQ, faculty can provide a different labtest based on the machine name to ensure students sitting side by side write a different test.

Several minutes prior to labtest, students using the lab machines will receive a warning message on their display that the machine will be going into labtest mode and that they need to save their files. After the grace period (default of 5 minutes), the machines will all be rebooted into labtest mode.

Once a machine boots into labtest mode, the login screen displays a banner that indicates that the machine is in labtest mode. If required, faculty can restrict which user can login to each host.

When students login, they are placed in the default desktop environment. A temporary home directory that is used for their work during labtest mode will be created. A web browser will automatically open and start at the default labtest home page. A description of labtest mode is displayed, and a disclaimer about remote monitoring. Students click the “Start Lab Test” button, and are taken to the labtest start page for the given booking.

Faculty can customize what happens when a student logs in to a machine. For example, they can copy in starter code into the student directory. A database could be initialized and pre-populated with data. A certain application can be started automatically.

If there is a power failure during labtest, then after power is restored, students can log back in and continue working on their labtest (if the labtest is not over).

If there is a hardware failure during labtest, then the student can move to another machine, and when they login, the TA will be prompted to authenticate, and the student data can be restored from anywhere they were previously working.

During labtest, student home directory data is synchronized to a repository every 15 minutes. Faculty can access the repository at any time and data is maintained for many months. If students fail to submit, faculty can restore the student work from the repository.

Students will continue to work on their labtest for the duration of the test. Students use either command line submit, web submit, or in some cases eClass to submit their completed work.

During labtest, faculty can use remote monitoring software to monitor student screens in the lab. They can take complete control of the student lab computer, or lock their screen. They can capture a screenshot. They can do this all from in the lab, or from home via the web.

A few minutes before the end of the labtest, students will receive a warning message on their display that the labtest is about to end. At the end of the labtest, all the machines are automatically rebooted and placed back into their original mode (Linux or Windows). When a machine is switched back to the standard operating mode, the temporary labtest home directories will be removed, but the final copy of the student data will be synced to the repository.

Faculty can configure a custom list of websites that labtest machines can access during their test with complete URL control. They can permit or reject whole websites, or even parts of a website using labtests secure proxy.

When Faculty are using eClass quizzes in labtest, access to messaging, “private files”, and other course pages are automatically blocked. For all labtests, certain general URLs are permitted such as the ones for PassportYork or DUO Authentication.

During a labtest, faculty can access a web interface to extend the test duration. For example, if there is no lab booking following the labtest, but a faculty member needs to give the students 15 minutes extra due to a power failure, they can do that without involving tech.

Faculty can test their labtest via the web using labtest cloud (ltcloud) service. They can access ltcloud from home, or from York. This crucial service allows faculty to develop and test their labtest in stages, as a student (ltstu). Before ltcloud came along, labtests would frequently have problems with inaccessible files, or user errors, but now that faculty can test their test as a student, the success rate of labtest is near perfect!

Labtest Setup with Labtest Assistant

Setting up a labtest requires creating many files and directories on our system. Labtest Assistant is a tool which will help you setup and manage your labtest with ease.

Usage

In order to setup your labtest, login to an EECS system via remotelab, then follow these instructions:

Open a Terminal (click “Activities” in the upper left corner, then click on “Terminal”), then start Labtest Assistant (labtest command) and pass in the concatenation of your course number and section (eg. 7777A for EECS7777A) followed by a space and then a test version name (eg. labtest1). For example, for course EECS7777A if you're having a test that you want to call labtest1:

    
% labtest 7777a labtest1

NOTE: The test version name can be whatever you choose. In this case, we chose “labtest1”. Other names might be: labtest1-lab1, labtest1-lab2, midterm, final, or whatever other name you feel describes the purpose of the test. Whatever name you choose, you will need to submit that exact name as part of your labtest booking.

After you hit enter, this is what you will see:

There is no directory setup for this course. Create one ([y]/n) ?y

Creating /eecs/dept/www/course/7777A
Creating /eecs/dept/www/course/7777A/labtest
Creating /eecs/dept/www/course/7777A/labtest/labtest1
Creating /eecs/dept/www/course/7777A/labtest/labtest1/index.html
Creating /eecs/dept/www/course/7777A/labtest/labtest1/ltinit
Creating /eecs/dept/www/course/7777A/labtest/labtest1/labtest.allow

Would you like a submit directory to be set up for labtest1 ([y]/n) ?y

Creating /eecs/course/7777A/submit/labtest1

Welcome to Labtest Assistant. Type "help" for options.

Labtest (7777A) [labtest1] > 

Labtest Assistant recognized that no labtest had been previously setup for this course. It created all the required labtest directories, a default labtest start page (index.html), and a directory for labtest submission.

Now, let's edit the start page for your labtest using the gedit command:

Labtest (7777A) [labtest1] > gedit

By default, the default start page for your labtest is called “index.html”. It will be opened in a GUI HTML editor. This makes it easy for you to edit the start page whether or not you know HTML. If you prefer to use the “vi” text editor instead, use the “edit” command instead of “gedit”:

Labtest (7777A) [labtest1] > edit

Modify the default start page, and add your own information such as your rules for the test, and links to other content such as slides or documentation. Change the index.html file, and customize it for your test. By default, index.html includes a link to the file “labtest.pdf”. This file is intended to contain your labtest questions in PDF format. If you don't want to use this filename, you can change the name to whatever you like.

NOTE: If you're creating a labtest which points to an eClass quiz, you'll want to include a link to your quiz directly on this page. It will look like this: https://eclass.yorku.ca/mod/quiz/view.php?id=12345 (you'll need to find the ID for your quiz by logging into eClass)

After you finish editing index.html, save the file.

Now, let's upload your labtest questions (eg. “labtest.pdf”) to your labtest directory. If you have the file on your PC, you can either sftp the file to indigo.eecs.yorku.ca, or, just drag the PDF from your desktop to your remotelab window. The file will be placed into your home directory.

Once labtest.pdf is in your EECS home directory, use Labtest Assistant to upload it to your course labtest directory using the “put” command:

Labtest (7777A) [labtest1] > put labtest.pdf

Put success.

You can also upload other files like slides, or documentation, and make that available to students in your test.

Labtest Assistant will ensure that file permissions are setup correctly.

Students will be able to submit their work to your labtest with command line submit or web submit.

When you create a new labtest, Labtest Assistant automatically asks you if you want it to set up a submission directory for your test:

Would you like a submit directory to be set up for labtest1 ([y]/n) ?y

If you choose “y”, the submission directory will be created, and enabled. It will have the same name as your test version name (eg. “labtest1”). When students are writing a test labtest1, they will only be able to submit to a submission directory called “labtest1”.

If you are doing an eClass based labtest, you might not need students to submit anything, so you'll answer the question with “n”.

If you make a mistake, it's easy to fix:

Labtest (7777A) [labtest1]  > submit add

Submit directory added.  It is enabled by default.

Labtest (7777A) [labtest1]  > submit del

Submit directory deleted.

The default labtest start page already includes a link to web submit: https://webapp.eecs.yorku.ca/submit

Congratulations!! Your labtest is now setup!

Once you submit your labtest booking request to the tech team, they will give you a custom URL which you can use to test your test in Labtest Cloud.

Available Commands

Labtest Assistant provides assistance in many areas of labtest setup. Use the “help” command for more information:

Labtest (7777A) [labtest1] > help

status                                       Display labtest status
list                                         List labtest files/directories
get <labtest-file> [<local-file>]            Download labtest file
put <local-file> [<labtest-file>]            Upload local file to labtest
rename <labtest-file> <labtest-file>         Rename labtest file
delete <labtest-file>                        Delete labtest file
edit [<labtest-file>]                        Edit labtest file (Default: index.html)
gedit [<labtest-file>]                       Edit labtest file in GUI editor (Default: index.html)
import <version>                             Import labtest version from current session
import <session> <term> <course> [<version>] Import labtest from another session/term (Default version: default)
files                                        Open labtest directory in file manager
ltcloud                                      Open Labtest Cloud web page
fix                                          Fix file permissions
restore <user>                               Restore files from <user>
clear                                        Clear the screen
quit                                         Quit

lock help                                    Display lock help options
ltinit help                                  Display ltinit help options
restrict help                                Display URL restriction help options
submit help                                  Display submit help options

help/?                                       Display this help text

A few notes:

There are also a few subcommands in Labtest Assistant - lock, ltinit, restrict, and submit which will be described below.

Labtest Lock

Labtest (7777A) [labtest1] > lock help

Labtest Lock Mode Help:

In labtest lock mode, the student is placed in a limited environment
with no access to a terminal.  By default, the only application available
is Firefox web browser.  Additional applications can be made available.

lock enable                                 Enable lock mode
lock disable                                Disable lock mode
lock list                                   List apps in lock mode
lock add <app> [<opts>] [<display-name>]    Add app to lock mode
lock delete <app>                           Delete app from lock mode
lock help                                   Display this help text

NOTE: As there is no access to a terminal, apps must bring up a GUI.

Example:

Enable lock mode (by default includes Web browser access only):

> lock enable

Want to make Eclipse available in lock mode?

> lock add eclipse

Add Matlab to lock mode (requires the option -desktop):

> lock add matlab -desktop

DISCLAIMER: Not all applications are suitable for lock mode.  For example, VSCode
            requires access to the terminal for compiling and debugging code.

Labtest Init

Labtest (7777A) [labtest1] > ltinit help

Labtest Ltinit Help:

ltinit list                                 List files in ltinit
ltinit get <ltinit-file>                    Download file from ltinit
ltinit put <local-file> [<ltinit-file>]     Upload file to ltinit
ltinit rename <ltinit-file> <ltinit-file>   Rename file in ltinit
ltinit delete <ltinit-file>                 Delete file from ltinit
ltinit edit <ltinit-file>                   Edit file from ltinit
ltinit help                                 Display this help text

Using the “ltinit” subcommand, you can get, put, rename, delete, or edit files in your labtest ltinit directory. The files in the ltinit directory are copied to each students ltinit folder when they login. For more information on ltinit, see here. Use of ltinit in labtest is entirely optional.

Labtest Restrict

Labtest (7777A) [labtest1] > restrict help

Labtest URL Restriction Help:

restrict list                                List labtest URL restrictions (including line numbers)
restrict add <restriction> [<line number>]   Add labtest URL restriction <restriction>
restrict eclass                              Allow access to eClass (*)
restrict delete <line-number>                Delete restriction <restriction>
restrict edit                                Edit labtest restrictions
restrict help                                Display this help text

To allow access to www.w3schools.com, and validator.w3.org:

labtest> restrict add www.w3schools.com
labtest> restrict add validator.w3.org

To reject one page on www.w3schools.com:

labtest> restrict add -www.w3schools.com/html/html_editors.asp

(*) To allow access to eClass Quiz/VPL, please read the following web page:

https://wiki.eecs.yorku.ca/dept/tdb/services:labtest:start#accessing_external_hosts_in_labtest_eclass_example

*** Don't forget - ALWAYS test your eClass quiz using ltcloud! https://webapp.eecs.yorku.ca/ltcloud ***

By default, labtest doesn't permit students to access external websites. Using the “restrict” subcommand, you can allow access to other web sites if your labtest requires it. For more information on the restriction format, please refer to this page:

For eClass specific restrictions, please refer to this page:

Labtest restrictions are entirely optional.

Labtest Submit

Labtest (7777A) [labtest1] > submit help

Labtest Submit Directory Help:

submit status        Display submit directory status
submit add           Add labtest submit directory
submit delete        Delete empty submit directory
submit enable        Enable submission  
submit disable       Disable submission
submit files         Open submit directory in file manager
submit help          Display this help text

Requesting Labtest Mode

Each term, the technical team books a significant number of labtests for faculty. Please help us to make the process more efficient by ensuring that your labtest booking request contains all the required information in the proper format.

The first time in a term when you book a labtest for a course, please provide us with:

(*) Before submitting a list of users, please read this carefully: Please make sure that you only send us EECS user IDs - not full names, not gmail, or other alternate email. While EECS usernames should be the same as a users Passport York username, some TAs may not have an EECS account yet. In this case, they won't be able to help your students move between machines during your test. When you submit a list of usernames, we add it to the booking as is. We don't check the usernames for validity. You can search for a users name here or by using the “finduser” command on our system (eg. finduser abc).

If a TA does not have an account, the process for them to get an account depends on the user type:

If the end time comes for any part of your booking, the checkbox in the “Select” column will be replaced with the word “DONE”, and you will no longer be able to control that part of the booking.

Canceling a Booking Extension

1. Check off the hosts for which you wish to cancel the time extension.

2. Press the “Cancel Extension” button. The extended time on the selected hosts will be canceled.

Setting Up Deferred Exams

Deferred exams for a course are normally run in the following term. For example if an exam is deferred from the winter term, the students will probably write the deferred exam at the start of the summer term. By this time, /eecs/course has changed to point to the current term. In the current term, the course directory may be owned by different faculty, or the course may not even be taught.

When you book your deferred test, please provide to tech a session, term, and course. When machines are placed into labtest mode, /eecs/course/COURSE will be pointing to your course directory from the previous session, and term, so submit will work perfectly fine. Your course labtest web folder from the previous session and term will be mounted to /eecs/dept/wwww/labtest.

For example, assume that the current session in 2016-17 summer. The course is 2031. A deferred test is to be held for 2031 from the winter term. Follow these steps:

1. Create a submit directory for your deferred exam:

% cd /eecs/dept/course/2016-17/W/2031/submit <- you already have this directory from the previous session and term
% mkdir final <-- you can call your submit directory anything you like.
% chmod 770 final
% chgrp labtest final

2. Configure your labtest questions:

% cd /eecs/dept/www/course_archive/2016-17/W/2031/labtest <- web folder from the previous term.

Modify index.html for your new test.

Instruct your student to submit like this:

<code>
submit 2031 final filename
              ^---- or whatever name you chose.

3. E-mail tech to schedule your deferred exam. Be sure to let them know that this is a deferred exam. Provide them with the session, term, and course to ensure that the proper directories are mounted during your test.

4. Once tech has scheduled your deferred exam, consult the schedule and get your test ID. Please arrange to test your test. See the section entitled “Testing Your Labtest” for more details.

If you have any questions, please consult with tech.

Testing Your Labtest

Testing your labtest from a student account is extremely important. It will help you uncover and correct any potential problems with your test including file and directory permissions, verification that all links are working, etc. It will avoid having to deal with these problems on the day of your labtest, ensuring a much smoother labtest experience for both you and your students.

There are two ways to test your labtest:

Labtest Cloud (LTCloud)

Labtest Cloud is the most ideal solution for testing your labtest at the university, or even remotely. To access Labtest Cloud, you need to have:

Access the Labtest Cloud URL here:

The best way to access ltcloud is directly from a web browser when you are connected to EECS Remotelab. If you want to access LTCloud directly from your home PC, you can use York VPN.

After connecting to the Labtest Cloud URL, you will be required to authenticate with your EECS username and password. After you successfully authenticate, the system will take about 10 seconds to setup your Labtest Cloud instance. Click on the “Connect to Labtest Cloud” button, and, right from your web browser, you'll be connected to a virtual system running labtest! You will be logged in as “ltstu” (labtest student) which is a ugrad account. Testing as a student is the best way to test your labtest.

If the Labtest Cloud web connection doesn't work for you, or if you prefer to use a local VNC client to access the Labtest Cloud, then please click the “Toggle Connection Details” button. This will reveal the VNC connection details including hostname, port (always 5900), and password. You can use these details to connect to the Labtest Cloud directly from your local computers VNC client. If you are on a MAC, click on the vnc URL which should open the local VNC client. If you're on a Windows PC, you can use the VNC client in MobaXterm or RealVNCs VNC Viewer.

When you're done with your Labtest Cloud instance, please be sure to logout. This ensures that your cloud instance will be free for someone else to use. To logout, click the small arrow at the top right corner of the screen, click on “Labtest Student”, then “Logout”. You can also double click the “Logout” icon on the desk. Your Labtest Cloud session will be terminated after 30 minutes of inactivity, or when you log out of the system. All files will be lost at that time. Note that if you close the Labtest Cloud window without logging out, someone will have to wait for your session to timeout before the host is available for use again.

Lab System

The next best way to test your labtest is on a lab system. Consult with tech, and we will place a lab system into labtest mode for your test at a specific scheduled date and time. Unless you are connecting hardware directly up to the lab machine, it's always preferable for you to use Labtest Cloud instead.

Labtest under Windows

Labtest is available for limited use under Windows, but requires consultation with tech. Machines will boot first into Linux labtest mode, and then Windows will run in a VirtualBox session. Students login to what appears to be a Linux system, but after logging in, the VirtualBox session is immediately started, and Windows boots taking over the full screen. With labtest running underneath, we get these benefits:

A few present limitations: