Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions lib/task-data/schemas/install-ubuntu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "rackhd/schemas/v1/task-schema",
"id": "rackhd/schemas/v1/tasks/install-ubuntu",
"copyright": "Copyright 2016, EMC, Inc.",
"title": "Install Ubuntu",
"description": "The parameters for Ubuntu installation",
"describeJob": "Job.Os.Install",
"definitions": {
"UbuntuSpecificOptions": {
"type": "object",
"properties": {
"baseUrl": {
"type": "string",
"description":"Url path to netboot installer directory",
"minLength": 1
}
},
"required": ["baseUrl"]
}
},
"allOf": [
{ "$ref": "common#/definitions/Options" },
{ "$ref": "install-os-types#/definitions/BasicOptions" },
{ "$ref": "install-os-types#/definitions/AdvanceOptions" },
{ "$ref": "#/definitions/UbuntuSpecificOptions" }
]
}
7 changes: 4 additions & 3 deletions lib/task-data/tasks/install-ubuntu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
friendlyName: 'Install Ubuntu',
injectableName: 'Task.Os.Install.Ubuntu',
implementsTask: 'Task.Base.Os.Install',
schemaRef: 'rackhd/schemas/v1/tasks/install-os-general',
schemaRef: 'rackhd/schemas/v1/tasks/install-ubuntu',
options: {
osType: 'linux', //readonly options, should avoid change it
profile: 'install-ubuntu.ipxe',
Expand All @@ -17,11 +17,12 @@ module.exports = {
completionUri: 'renasar-ansible.pub',
version: 'trusty',
repo: '{{api.server}}/ubuntu',
netImage: '{{api.server}}/ubuntu/install/filesystem.squashfs',
baseUrl: 'dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64',
rootPassword: "RackHDRocks!",
interface: "auto",
installDisk: "/dev/sda",
kvm: false
kvm: false,
kargs:{}
},
properties: {
os: {
Expand Down
33 changes: 33 additions & 0 deletions spec/lib/task-data/schemas/install-ubuntu-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2016, EMC, Inc.
/* jshint node: true */

'use strict';

describe(require('path').basename(__filename), function() {
var schemaFilePath = '/lib/task-data/schemas/install-ubuntu.json';

var partialCanonical = {
"baseUrl": "ubuntu.baseUrl",
};

var positiveSetParam = {
};

var negativeSetParam = {
};

var positiveUnsetParam = [
];

var negativeUnsetParam = [
"baseUrl",
];

var installOsCommonHelper = require('./install-os-schema-ut-helper');
var canonical = _.defaults(partialCanonical, installOsCommonHelper.canonical);
installOsCommonHelper.test(schemaFilePath, canonical);

var SchemaUtHelper = require('./schema-ut-helper');
new SchemaUtHelper(schemaFilePath, canonical).batchTest(
positiveSetParam, negativeSetParam, positiveUnsetParam, negativeUnsetParam);
});