1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

add groups feature

This commit is contained in:
Denis barbaron 2019-06-12 10:29:07 +02:00
parent 6fd750dad5
commit 7f5dc4c152
119 changed files with 12416 additions and 402 deletions

View file

@ -1,3 +1,7 @@
/**
* Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
**/
var util = require('util')
var uuid = require('uuid')
@ -7,10 +11,8 @@ var dbapi = require('../db/api')
var devices = require('stf-device-db/dist/devices-latest')
module.exports.generate = function(wantedModel) {
var serial = util.format(
'fake-%s'
, uuid.v4(null, new Buffer(16)).toString('base64')
)
// no base64 because some characters as '=' or '/' are not compatible through API (delete devices)
const serial = 'fake-' + util.format('%s', uuid.v4()).replace(/-/g, '')
return dbapi.saveDeviceInitialState(serial, {
provider: {
@ -28,7 +30,7 @@ module.exports.generate = function(wantedModel) {
, model: model
, version: '4.1.2'
, abi: 'armeabi-v7a'
, sdk: 8 + Math.floor(Math.random() * 12)
, sdk: (8 + Math.floor(Math.random() * 12)).toString() // string required!
, display: {
density: 3
, fps: 60
@ -49,6 +51,8 @@ module.exports.generate = function(wantedModel) {
, phoneNumber: '0000000000'
}
, product: model
, cpuPlatform: 'msm8996'
, openGLESVersion: '3.1'
})
})
.then(function() {