Skip to content
Snippets Groups Projects
Commit e3ed7533 authored by ale's avatar ale
Browse files

Merge branch 'master' into 'master'

Minor fixes on test instance

See merge request !1
parents 45da127c 630a8871
No related branches found
No related tags found
No related merge requests found
...@@ -48,8 +48,12 @@ func (afs *ByArtistFilesystem) Stat(path string) (Attr, error) { ...@@ -48,8 +48,12 @@ func (afs *ByArtistFilesystem) Stat(path string) (Attr, error) {
if len(p) == 3 { if len(p) == 3 {
return afs.getSong(p[0], p[1], p[2]) return afs.getSong(p[0], p[1], p[2])
} else if len(p) < 3 { } else if len(p) < 3 {
name := "/"
if len(p) > 0 {
name = p[len(p)-1]
}
attr := Attr{ attr := Attr{
Name: p[len(p)-1], Name: name,
IsDir: true, IsDir: true,
} }
return attr, nil return attr, nil
......
...@@ -24,16 +24,16 @@ generate_server_conf() { ...@@ -24,16 +24,16 @@ generate_server_conf() {
cat >$1 <<EOF cat >$1 <<EOF
{ {
"db_path": "${root}/djrandom.db", "db_path": "${root}/djrandom.db",
"db_addr": "localhost:3007", "db_addr": "127.0.0.1:3007",
"storage_root": "${root}/fs", "storage_root": "${root}/fs",
"storage_pmap": "${root}/part.json", "storage_pmap": "${root}/part.json",
"storage_self": "http://localhost:3003", "storage_self": "http://127.0.0.1:3003",
"storage_key_id": "abcdef", "storage_key_id": "abcdef",
"storage_key_secret": "123456", "storage_key_secret": "123456",
"index_pmap": "${root}/part-index.json", "index_pmap": "${root}/part-index.json",
"index_self": "localhost:3002", "index_self": "127.0.0.1:3002",
"index_file": "${root}/djindex", "index_file": "${root}/djindex",
"task_server_addr": "http://localhost:3005", "task_server_addr": "http://127.0.0.1:3005",
"last_fm_api_key": "1234" "last_fm_api_key": "1234"
} }
EOF EOF
...@@ -44,7 +44,7 @@ generate_client_conf() { ...@@ -44,7 +44,7 @@ generate_client_conf() {
{ {
"music_dir": "${music_dir}", "music_dir": "${music_dir}",
"db_path": "${root}/djclient.db", "db_path": "${root}/djclient.db",
"server": "http://localhost:3001", "server": "http://127.0.0.1:3001",
"auth_key": "${auth_key}", "auth_key": "${auth_key}",
"auth_secret": "${auth_secret}" "auth_secret": "${auth_secret}"
} }
...@@ -52,17 +52,19 @@ EOF ...@@ -52,17 +52,19 @@ EOF
} }
generate_storage_part() { generate_storage_part() {
${bindir}/parttool --parts=16 --file=$1 create http://localhost:3003 ${bindir}/parttool --parts=16 --file=$1 create http://127.0.0.1:3003
} }
generate_index_part() { generate_index_part() {
${bindir}/parttool --parts=16 --file=$1 create localhost:3002 ${bindir}/parttool --parts=16 --file=$1 create 127.0.0.1:3002
} }
start_daemons() { start_daemons() {
for d in $DAEMONS ; do for d in $DAEMONS ; do
local pidfile=${root}/${d}.pid local pidfile=${root}/${d}.pid
${bindir}/${d} --config=${root}/djrandom.conf --pid-file=${pidfile} & local logfile=${root}/${d}.log
${bindir}/${d} --config=${root}/djrandom.conf --pid-file=${pidfile} \
--log-file=${logfile} &
done done
} }
...@@ -100,6 +102,11 @@ run_mr_stats() { ...@@ -100,6 +102,11 @@ run_mr_stats() {
| ${bindir}/mr_stats --config=${root}/djrandom.conf --mapreduce | ${bindir}/mr_stats --config=${root}/djrandom.conf --mapreduce
} }
run_mr_davfs() {
${bindir}/mr_dump_bucket --config=${root}/djrandom.conf --bucket=song \
| ${bindir}/mr_davfs --config=${root}/djrandom.conf --mapreduce
}
setup setup
start_daemons start_daemons
sleep 1 sleep 1
...@@ -111,6 +118,7 @@ echo ${root} ...@@ -111,6 +118,7 @@ echo ${root}
sleep 1 sleep 1
run_client run_client
run_mr_stats run_mr_stats
run_mr_davfs
echo "*** TEST COMPLETE ***" echo "*** TEST COMPLETE ***"
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment