From 1547c7c49a1852852ffbac0737d0ffdf54addda9 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 1 Mar 2011 18:47:03 +0100 Subject: isotests: entry and listing of release engineering tests Add a new project for entry and listing of testing results for our release ISOs. This will assist the release engineering team with determining a good ISO to make into the real deal. Signed-off-by: Dan McGee --- isotests/__init__.py | 0 isotests/admin.py | 10 +++++ isotests/fixtures/bootloaders.json | 23 ++++++++++ isotests/fixtures/filesystems.json | 23 ++++++++++ isotests/fixtures/hardware.json | 44 +++++++++++++++++++ isotests/fixtures/installtype.json | 30 +++++++++++++ isotests/fixtures/modules.json | 37 ++++++++++++++++ isotests/fixtures/source.json | 23 ++++++++++ isotests/models.py | 87 ++++++++++++++++++++++++++++++++++++++ isotests/templates/iso_list.html | 2 + isotests/tests.py | 23 ++++++++++ isotests/urls.py | 16 +++++++ isotests/views.py | 24 +++++++++++ settings.py | 1 + templates/isotests/add.html | 13 ++++++ templates/isotests/iso_list.html | 18 ++++++++ templates/isotests/test_list.html | 18 ++++++++ 17 files changed, 392 insertions(+) create mode 100644 isotests/__init__.py create mode 100644 isotests/admin.py create mode 100644 isotests/fixtures/bootloaders.json create mode 100644 isotests/fixtures/filesystems.json create mode 100644 isotests/fixtures/hardware.json create mode 100644 isotests/fixtures/installtype.json create mode 100644 isotests/fixtures/modules.json create mode 100644 isotests/fixtures/source.json create mode 100644 isotests/models.py create mode 100644 isotests/templates/iso_list.html create mode 100644 isotests/tests.py create mode 100644 isotests/urls.py create mode 100644 isotests/views.py create mode 100644 templates/isotests/add.html create mode 100644 templates/isotests/iso_list.html create mode 100644 templates/isotests/test_list.html diff --git a/isotests/__init__.py b/isotests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/isotests/admin.py b/isotests/admin.py new file mode 100644 index 00000000..03b5fbab --- /dev/null +++ b/isotests/admin.py @@ -0,0 +1,10 @@ +from isotests.models import * +from django.contrib import admin + +admin.site.register(Iso) +admin.site.register(Hardware) +admin.site.register(InstallType) +admin.site.register(Source) +admin.site.register(Filesystem) +admin.site.register(Module) +admin.site.register(Bootloader) diff --git a/isotests/fixtures/bootloaders.json b/isotests/fixtures/bootloaders.json new file mode 100644 index 00000000..545b5c0c --- /dev/null +++ b/isotests/fixtures/bootloaders.json @@ -0,0 +1,23 @@ +[ + { + "pk": 1, + "model": "isotests.bootloader", + "fields": { + "name": "grub" + } + }, + { + "pk": 2, + "model": "isotests.bootloader", + "fields": { + "name": "syslinux" + } + }, + { + "pk": 3, + "model": "isotests.bootloader", + "fields": { + "name": "other/manual" + } + } +] diff --git a/isotests/fixtures/filesystems.json b/isotests/fixtures/filesystems.json new file mode 100644 index 00000000..4d3f1bc4 --- /dev/null +++ b/isotests/fixtures/filesystems.json @@ -0,0 +1,23 @@ +[ + { + "pk": 1, + "model": "isotests.filesystem", + "fields": { + "name": "autoprepare (check the installed system, incl fstab)" + } + }, + { + "pk": 2, + "model": "isotests.filesystem", + "fields": { + "name": "manual" + } + }, + { + "pk": 3, + "model": "isotests.filesystem", + "fields": { + "name": "from config file" + } + } +] diff --git a/isotests/fixtures/hardware.json b/isotests/fixtures/hardware.json new file mode 100644 index 00000000..c9169146 --- /dev/null +++ b/isotests/fixtures/hardware.json @@ -0,0 +1,44 @@ +[ + { + "pk": 1, + "model": "isotests.hardware", + "fields": { + "name": "virtualbox" + } + }, + { + "pk": 2, + "model": "isotests.hardware", + "fields": { + "name": "qemu" + } + }, + { + "pk": 3, + "model": "isotests.hardware", + "fields": { + "name": "intel i686" + } + }, + { + "pk": 4, + "model": "isotests.hardware", + "fields": { + "name": "intel x86_64" + } + }, + { + "pk": 5, + "model": "isotests.hardware", + "fields": { + "name": "amd i686" + } + }, + { + "pk": 6, + "model": "isotests.hardware", + "fields": { + "name": "amd x86_64" + } + } +] diff --git a/isotests/fixtures/installtype.json b/isotests/fixtures/installtype.json new file mode 100644 index 00000000..d23bd4b2 --- /dev/null +++ b/isotests/fixtures/installtype.json @@ -0,0 +1,30 @@ +[ + { + "pk": 1, + "model": "isotests.installtype", + "fields": { + "name": "automatic install generic example" + } + }, + { + "pk": 2, + "model": "isotests.installtype", + "fields": { + "name": "automatic install fancy example" + } + }, + { + "pk": 3, + "model": "isotests.installtype", + "fields": { + "name": "automatic install custom config (specify in comments)" + } + }, + { + "pk": 4, + "model": "isotests.installtype", + "fields": { + "name": "interactive install" + } + } +] diff --git a/isotests/fixtures/modules.json b/isotests/fixtures/modules.json new file mode 100644 index 00000000..27d04c7a --- /dev/null +++ b/isotests/fixtures/modules.json @@ -0,0 +1,37 @@ +[ + { + "pk": 1, + "model": "isotests.module", + "fields": { + "name": "lvm2" + } + }, + { + "pk": 2, + "model": "isotests.module", + "fields": { + "name": "dm_crypt" + } + }, + { + "pk": 3, + "model": "isotests.module", + "fields": { + "name": "softraid" + } + }, + { + "pk": 4, + "model": "isotests.module", + "fields": { + "name": "nilfs2" + } + }, + { + "pk": 5, + "model": "isotests.module", + "fields": { + "name": "btrfs" + } + } +] diff --git a/isotests/fixtures/source.json b/isotests/fixtures/source.json new file mode 100644 index 00000000..1bf835a1 --- /dev/null +++ b/isotests/fixtures/source.json @@ -0,0 +1,23 @@ +[ + { + "pk": 1, + "model": "isotests.source", + "fields": { + "name": "net install manual networking config (Check that it works + rc.conf, resolv.conf, mirrorlist)" + } + }, + { + "pk": 2, + "model": "isotests.source", + "fields": { + "name": "net install dhcp (Check that it works + rc.conf)" + } + }, + { + "pk": 3, + "model": "isotests.source", + "fields": { + "name": "core" + } + } +] diff --git a/isotests/models.py b/isotests/models.py new file mode 100644 index 00000000..1eaca163 --- /dev/null +++ b/isotests/models.py @@ -0,0 +1,87 @@ +from django.db import models + +# Create your models here. +class Iso(models.Model): + date = models.DateField() + + def __unicode__(self): + return str(self.date) + +class Hardware(models.Model): + name = models.CharField(max_length=200) + + def __unicode__(self): + return self.name + +class InstallType(models.Model): + name = models.CharField(max_length=200) + + def __unicode__(self): + return self.name + +class Source(models.Model): + name = models.CharField(max_length=200) + + def __unicode__(self): + return self.name + +class Filesystem(models.Model): + name = models.CharField(max_length=200) + + def __unicode__(self): + return self.name + +class Module(models.Model): + name = models.CharField(max_length=200) + + def __unicode__(self): + return self.name + +class Bootloader(models.Model): + name = models.CharField(max_length=200) + + def __unicode__(self): + return self.name + +class Test(models.Model): + ARCH_CHOICES = ( + ('d86', 'dual, option i686'), + ('d64', 'dual, option x86_64'), + ('x86', 'i686'), + ('x64', 'x86_64') + ) + + ISOTYPE_CHOICES = ( + ('c', 'core'), + ('n', 'net') + ) + + BOOTTYPE_CHOICES = ( + ('o', 'optical'), + ('u', 'usb'), + ('p', 'pxe') + ) + + CLOCK_CHOICES = ( + ('d', 'default'), + ('m', 'configured manually'), + ('n', 'NTP') + ) + + user_name = models.CharField(max_length=500) + user_email = models.EmailField() + iso = models.ForeignKey(Iso) + arch = models.CharField(max_length=3, choices=ARCH_CHOICES) + isotype = models.CharField(max_length=1, choices=ISOTYPE_CHOICES) + boottype = models.CharField(max_length=1, choices=BOOTTYPE_CHOICES) + hardwaretype = models.ForeignKey(Hardware) + installtype = models.ForeignKey(InstallType) + source = models.ForeignKey(Source) + clock = models.CharField(max_length=1, choices=CLOCK_CHOICES) + filesystem = models.ForeignKey(Filesystem) + ms = models.ManyToManyField(Module) + rollback = models.BooleanField() + rollback_filesystem = models.ForeignKey(Filesystem, related_name="rollback_test") + rollback_modules = models.ManyToManyField(Module, related_name="rollback_test") + success = models.BooleanField() + comments = models.TextField() diff --git a/isotests/templates/iso_list.html b/isotests/templates/iso_list.html new file mode 100644 index 00000000..06572739 --- /dev/null +++ b/isotests/templates/iso_list.html @@ -0,0 +1,2 @@ +hello there +bla diff --git a/isotests/tests.py b/isotests/tests.py new file mode 100644 index 00000000..2247054b --- /dev/null +++ b/isotests/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/isotests/urls.py b/isotests/urls.py new file mode 100644 index 00000000..fdde9e3b --- /dev/null +++ b/isotests/urls.py @@ -0,0 +1,16 @@ +from django.conf.urls.defaults import patterns +from isotests.models import Test + +info_dict = { + 'queryset': Test.objects.all() +} + +urlpatterns = patterns('isotests.views', + (r'^add/$', 'add_result') +) + +urlpatterns += patterns('', + (r'^$', 'django.views.generic.list_detail.object_list', info_dict) +) + +# vim: set ts=4 sw=4 et: diff --git a/isotests/views.py b/isotests/views.py new file mode 100644 index 00000000..742be8ff --- /dev/null +++ b/isotests/views.py @@ -0,0 +1,24 @@ +# Create your views here. +from django.http import HttpResponse, HttpResponseRedirect +from django.forms import ModelForm +from isotests.models import Test +from django.shortcuts import render_to_response +from django.template import RequestContext + +class TestForm(ModelForm): + class Meta: + model = Test + +def add_result(request): + if request.method == 'POST': # If the form has been submitted... + form = TestForm(request.POST) # A form bound to the post data + if form.is_valid(): # All validation rules pass + form.save() + return HttpResponseRedirect('/isotests') # Redirect after POST + else: + form = TestForm() # An unbound form + + return render_to_response('isotests/add.html', { + 'form': form, + }, + context_instance=RequestContext(request)) diff --git a/settings.py b/settings.py index 1d26d9eb..107baa17 100644 --- a/settings.py +++ b/settings.py @@ -104,6 +104,7 @@ 'devel', 'public', 'south', # database migration support + 'isotests', ) ## Import local settings diff --git a/templates/isotests/add.html b/templates/isotests/add.html new file mode 100644 index 00000000..07d3ed81 --- /dev/null +++ b/templates/isotests/add.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block title %}Arch Linux - Test Result Entry{% endblock %} + +{% block content %} +
+

Arch releng iso build test result entry

+
{% csrf_token %} + {{ form.as_p }} + +
+
+{% endblock %} diff --git a/templates/isotests/iso_list.html b/templates/isotests/iso_list.html new file mode 100644 index 00000000..f94bbe1a --- /dev/null +++ b/templates/isotests/iso_list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %}Arch Linux - Testresults{% endblock %} + +{% block content %} +{% if object_list %} +
+

Arch releng iso buid test results

+
    + {% for iso in object_list %} +
  • {{ iso }}
  • + {% endfor %} +
+ {% else %} +

No tests are available.

+ {% endif %} +
+{% endblock %} diff --git a/templates/isotests/test_list.html b/templates/isotests/test_list.html new file mode 100644 index 00000000..1ef39a4c --- /dev/null +++ b/templates/isotests/test_list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %}Arch Linux - Testresults{% endblock %} + +{% block content %} +
+

Arch releng iso build test results

+ {% if object_list %} + + {% else %} +

No test results are available.

+ {% endif %} +
+{% endblock %} -- cgit v1.2.3-54-g00ecf