aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/real-world
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/real-world')
-rw-r--r--server/tests/real-world/real-world.js3
-rw-r--r--server/tests/real-world/tools/upload.js7
2 files changed, 7 insertions, 3 deletions
diff --git a/server/tests/real-world/real-world.js b/server/tests/real-world/real-world.js
index 239b790ae..f17c83f85 100644
--- a/server/tests/real-world/real-world.js
+++ b/server/tests/real-world/real-world.js
@@ -201,13 +201,14 @@ function upload (servers, numServer, callback) {
201 if (!callback) callback = function () {} 201 if (!callback) callback = function () {}
202 202
203 const name = Date.now() + ' name' 203 const name = Date.now() + ' name'
204 const category = 4
204 const description = Date.now() + ' description' 205 const description = Date.now() + ' description'
205 const tags = [ Date.now().toString().substring(0, 5) + 't1', Date.now().toString().substring(0, 5) + 't2' ] 206 const tags = [ Date.now().toString().substring(0, 5) + 't1', Date.now().toString().substring(0, 5) + 't2' ]
206 const file = 'video_short1.webm' 207 const file = 'video_short1.webm'
207 208
208 console.log('Uploading video to server ' + numServer) 209 console.log('Uploading video to server ' + numServer)
209 210
210 videosUtils.uploadVideo(servers[numServer].url, servers[numServer].accessToken, name, description, tags, file, callback) 211 videosUtils.uploadVideo(servers[numServer].url, servers[numServer].accessToken, name, category, description, tags, file, callback)
211} 212}
212 213
213function update (servers, numServer, callback) { 214function update (servers, numServer, callback) {
diff --git a/server/tests/real-world/tools/upload.js b/server/tests/real-world/tools/upload.js
index ba08028cf..49076ee2a 100644
--- a/server/tests/real-world/tools/upload.js
+++ b/server/tests/real-world/tools/upload.js
@@ -9,6 +9,7 @@ program
9 .option('-u, --url <url>', 'Server url') 9 .option('-u, --url <url>', 'Server url')
10 .option('-a, --access-token <token>', 'Access token') 10 .option('-a, --access-token <token>', 'Access token')
11 .option('-n, --name <name>', 'Video name') 11 .option('-n, --name <name>', 'Video name')
12 .option('-d, --category <category number>', 'Category number')
12 .option('-d, --description <description>', 'Video description') 13 .option('-d, --description <description>', 'Video description')
13 .option('-t, --tags <tags>', 'Video tags', list) 14 .option('-t, --tags <tags>', 'Video tags', list)
14 .option('-f, --file <file>', 'Video absolute file path') 15 .option('-f, --file <file>', 'Video absolute file path')
@@ -18,6 +19,7 @@ if (
18 !program.url || 19 !program.url ||
19 !program.accessToken || 20 !program.accessToken ||
20 !program.name || 21 !program.name ||
22 !program.category ||
21 !program.description || 23 !program.description ||
22 !program.tags || 24 !program.tags ||
23 !Array.isArray(program.tags) || 25 !Array.isArray(program.tags) ||
@@ -34,6 +36,7 @@ fs.access(program.file, fs.F_OK, function (err) {
34 program.url, 36 program.url,
35 program.accessToken, 37 program.accessToken,
36 program.name, 38 program.name,
39 program.category,
37 program.description, 40 program.description,
38 program.tags, 41 program.tags,
39 program.file 42 program.file
@@ -46,10 +49,10 @@ function list (val) {
46 return val.split(',') 49 return val.split(',')
47} 50}
48 51
49function upload (url, accessToken, name, description, tags, file) { 52function upload (url, accessToken, name, category, description, tags, file) {
50 console.log('Uploading %s video...', program.name) 53 console.log('Uploading %s video...', program.name)
51 54
52 utils.uploadVideo(url, accessToken, name, description, tags, file, function (err) { 55 utils.uploadVideo(url, accessToken, name, category, description, tags, file, function (err) {
53 if (err) throw err 56 if (err) throw err
54 57
55 console.log('Video uploaded.') 58 console.log('Video uploaded.')