summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Willemsen <tom.willemsen@archlinux.us>2011-03-01 18:47:03 +0100
committerDan McGee <dan@archlinux.org>2011-04-28 13:15:54 -0500
commit1547c7c49a1852852ffbac0737d0ffdf54addda9 (patch)
tree57870efa44b40ffa37e40dd90fa35d96c9b04038
parente6717510a0a7976fca1ccd3e5aaf1a16123a1ad4 (diff)
downloadarchweb-1547c7c49a1852852ffbac0737d0ffdf54addda9.tar.gz
archweb-1547c7c49a1852852ffbac0737d0ffdf54addda9.zip
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 <dan@archlinux.org>
-rw-r--r--isotests/__init__.py0
-rw-r--r--isotests/admin.py10
-rw-r--r--isotests/fixtures/bootloaders.json23
-rw-r--r--isotests/fixtures/filesystems.json23
-rw-r--r--isotests/fixtures/hardware.json44
-rw-r--r--isotests/fixtures/installtype.json30
-rw-r--r--isotests/fixtures/modules.json37
-rw-r--r--isotests/fixtures/source.json23
-rw-r--r--isotests/models.py87
-rw-r--r--isotests/templates/iso_list.html2
-rw-r--r--isotests/tests.py23
-rw-r--r--isotests/urls.py16
-rw-r--r--isotests/views.py24
-rw-r--r--settings.py1
-rw-r--r--templates/isotests/add.html13
-rw-r--r--templates/isotests/iso_list.html18
-rw-r--r--templates/isotests/test_list.html18
17 files changed, 392 insertions, 0 deletions
diff --git a/isotests/__init__.py b/isotests/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/isotests/__init__.py
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 @@ INSTALLED_APPS = (
'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 %}
+<div class="box">
+ <h2>Arch releng iso build test result entry</h2>
+ <form action="" method="post">{% csrf_token %}
+ {{ form.as_p }}
+ <input type="submit" value="Submit" />
+ </form>
+</div>
+{% 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 %}
+<div class="box">
+ <h2>Arch releng iso buid test results</h2>
+ <ul>
+ {% for iso in object_list %}
+ <li><a href="/tests/{{ iso.id }}/">{{ iso }}</a></li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>No tests are available.</p>
+ {% endif %}
+</div>
+{% 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 %}
+<div class="box">
+ <h2>Arch releng iso build test results</h2>
+ {% if object_list %}
+ <ul>
+ {% for test in object_list %}
+ <li><a href="/tests/{{ test.id }}/">{{ test.iso }}</a></li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>No test results are available.</p>
+ {% endif %}
+</div>
+{% endblock %}